@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Thai:wght@300;400;500;600;700;800;900&family=Outfit:wght@300;400;500;600;700;800;900&display=swap');

:root {
  /* thp-style Color & Layout Tokens */
  --navy: #06295a;
  --navy2: #031a3f;
  --red: #ef233c;
  --blue: #1f5fbd;
  --ink: #21152c;
  --muted: #5c6477;
  --line: rgba(9, 33, 72, 0.10);
  --glass: rgba(255, 255, 255, 0.78);
  --shadow: 0 18px 42px rgba(6, 28, 72, 0.14);
  --soft: 0 8px 24px rgba(6, 28, 72, 0.10);
  --content: 1580px;
  --side: 240px;
  --header: 92px;

  /* App Overlay & Modal Tokens */
  --thp-red: #E31B23;
  --thp-red-hover: #B51218;
  --thp-blue: #0A2240;
  --thp-blue-light: #1A3E6C;
  --thp-bg: #f3f6fb;
  --border-color: #E2E8F0;
  --success: #2F855A;
  --warning: #DD6B20;
  --danger: #E53E3E;
  --info: #3182CE;
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --transition: all 0.3s ease;
}

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

body {
  font-family: "Segoe UI", "Noto Sans Thai", "Outfit", Tahoma, sans-serif;
  background-color: var(--thp-bg);
  color: var(--ink);
  overflow-x: hidden;
}

/* Master App Container */
.app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--side) 1fr;
  grid-template-rows: var(--header) 1fr;
}

/* Left Sidebar Navigation */
.sidebar {
  grid-row: 1/3;
  background: #ffffff;
  color: #1F2937;
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--side);
  z-index: 20;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
  border-right: 1px solid #E5E7EB;
  display: flex;
  flex-direction: column;
}

.sidebar-logo-container {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid #E5E7EB;
  background: #ffffff;
}

.sidebar-logo-icon {
  background-color: var(--thp-red);
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: white;
}

.sidebar-logo-text {
  display: flex;
  flex-direction: column;
}

.sidebar-logo-title {
  font-size: 15px;
  font-weight: 800;
  color: #1F2937;
  line-height: 1.2;
}

.sidebar-logo-title-highlight {
  color: var(--thp-red);
}

.sidebar-logo-desc {
  font-size: 11px;
  color: #9CA3AF;
}

.sidebar-badge {
  display: none;
  margin-left: auto;
  background-color: var(--danger);
  color: white;
  padding: 2px 6px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: bold;
}

.sidebar-reset-btn {
  cursor: pointer;
  color: var(--danger);
  display: flex;
  align-items: center;
  padding: 4px;
}

.nav {
  padding-top: 16px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-header {
  font-size: 12px;
  font-weight: 700;
  color: #9CA3AF;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 16px 24px 8px;
}

.nav a {
  height: 48px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  color: #4B5563;
  text-decoration: none;
  font-weight: 600;
  font-size: 14.5px;
  border-radius: 8px;
  margin: 0 12px;
  transition: all 0.2s ease;
}

.nav a:hover {
  background: #F3F4F6;
  color: #1F2937;
}

.nav a .ico {
  width: 20px;
  text-align: center;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav a.active {
  background: #FFF1F2;
  color: var(--thp-red);
  font-weight: 700;
}

/* Sidebar User Profile Card */
.sidebar-user-profile {
  border-top: 1px solid #E5E7EB;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: #F9FAFB;
}

.sidebar-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: var(--thp-red);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
}

.sidebar-user-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.sidebar-user-name {
  font-size: 13.5px;
  font-weight: 700;
  color: #1F2937;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-email {
  font-size: 11px;
  color: #6B7280;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Header Topbar */
.topbar {
  grid-column: 2;
  position: sticky;
  top: 0;
  z-index: 18;
  height: var(--header);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(18px);
  display: flex;
  align-items: center;
  padding: 0 44px;
  gap: 32px;
  box-shadow: 0 2px 24px rgba(5, 24, 64, 0.08);
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 360px;
}

.logo svg {
  height: 54px;
  width: auto;
  display: block;
}

.top-search {
  flex: 1;
  display: flex;
  justify-content: center;
}

.searchbox {
  width: min(560px, 100%);
  height: 50px;
  border-radius: 10px;
  border: 1px solid #d9dee9;
  background: #f8f9fc;
  display: flex;
  align-items: center;
  padding: 0 18px;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
  gap: 12px;
  cursor: text;
}

.searchbox input {
  border: 0;
  outline: 0;
  background: transparent;
  flex: 1;
  font-size: 16px;
  font-family: inherit;
  color: #3d4353;
}

.searchbox span {
  display: flex;
  align-items: center;
  color: #76829a;
}

.head-actions {
  display: flex;
  align-items: center;
  gap: 22px;
}

.chat-toggle-btn {
  cursor: pointer;
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px;
  border-radius: 99px;
  background: linear-gradient(135deg, #FFF1F2 0%, #FFE4E6 100%);
  border: 1px solid #FECDD3;
  color: var(--thp-red);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(239, 35, 60, 0.05), 0 0 0 1px rgba(239, 35, 60, 0.02);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  animation: ai-pulse 3s infinite alternate;
}

/* Pulsing outer shadow glow (represents the AI "breathing") */
@keyframes ai-pulse {
  0% {
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.05), 0 0 0 1px rgba(220, 38, 38, 0.05);
    border-color: #FECDD3;
  }
  50% {
    box-shadow: 0 4px 20px rgba(220, 38, 38, 0.15), 0 0 0 2px rgba(220, 38, 38, 0.1);
    border-color: #FCA5A5;
  }
  100% {
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.05), 0 0 0 1px rgba(220, 38, 38, 0.05);
    border-color: #FECDD3;
  }
}

/* Reflective swept light effect (Sweeps across the button) */
.chat-toggle-btn::after {
  content: '';
  position: absolute;
  top: 0;
  left: -150%;
  width: 50%;
  height: 100%;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.8) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  transform: skewX(-20deg);
  transition: none;
  animation: ai-shimmer 4s infinite;
}

@keyframes ai-shimmer {
  0% {
    left: -150%;
  }
  30% {
    left: 150%;
  }
  100% {
    left: 150%;
  }
}

/* Premium Hover State */
.chat-toggle-btn:hover {
  transform: translateY(-2px) scale(1.02);
  background: linear-gradient(135deg, var(--thp-red) 0%, var(--thp-red-hover) 100%);
  color: #FFFFFF;
  border-color: var(--thp-red-hover);
  box-shadow: 0 6px 24px rgba(220, 38, 38, 0.3), 0 0 0 2px rgba(220, 38, 38, 0.2);
}

.chat-toggle-btn:hover svg {
  transform: rotate(10deg);
  stroke: #FFFFFF;
  filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.6));
}

.chat-toggle-btn svg {
  transition: all 0.3s ease;
}

/* Pulsing heart-beat indicator to show AI is online/alive */
.chat-toggle-btn::before {
  content: '';
  position: absolute;
  top: 6px;
  right: 6px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #22C55E; /* Green status dot */
  box-shadow: 0 0 8px #22C55E;
  animation: beacon-pulse 1.5s infinite;
}

@keyframes beacon-pulse {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 5px rgba(34, 197, 94, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
  }
}

.chat-toggle-btn:hover::before {
  background-color: #FFFFFF;
  box-shadow: 0 0 8px #FFFFFF;
  animation: beacon-pulse-white 1.5s infinite;
}

@keyframes beacon-pulse-white {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 5px rgba(255, 255, 255, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
  }
}

.bell {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #08295d;
  cursor: pointer;
  transition: var(--transition);
}

.bell:hover {
  background-color: #F1F5F9;
}

.badge {
  position: absolute;
  right: 4px;
  top: 2px;
  background: var(--red);
  color: #fff;
  border-radius: 999px;
  padding: 0 6px;
  font-size: 13px;
  font-weight: 800;
}

.user {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.user:hover {
  background-color: #F1F5F9;
}

.avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--navy);
  color: white;
  font-weight: 800;
  font-size: 16px;
}

.user b {
  display: block;
  color: var(--navy);
  font-size: 14.5px;
  font-weight: 700;
}

.user span {
  font-size: 12px;
  color: #303848;
}

.gridbtn {
  display: grid;
  place-items: center;
  color: #08295d;
  cursor: pointer;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  transition: var(--transition);
}

.gridbtn:hover {
  background-color: #F1F5F9;
}

/* Page Wrapper */
.page {
  grid-column: 2;
  padding-bottom: 34px;
}

/* Hero Section */
.hero {
  min-height: 675px;
  position: relative;
  overflow: hidden;
  padding: 58px 56px 28px;
  background-image: linear-gradient(90deg, rgba(255, 255, 255, 0.94) 0%, rgba(255, 255, 255, 0.80) 31%, rgba(255, 255, 255, 0.26) 58%, rgba(255, 255, 255, 0.06) 100%), url('thp-style/assets/bg/hero-thpost-counter-sign.jpg');
  background-size: cover;
  background-position: center top;
}

.hero:after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 180px;
  background: linear-gradient(180deg, rgba(243, 246, 251, 0), #f3f6fb 88%);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 2;
  max-width: var(--content);
  margin: 0 auto;
}

.welcome {
  max-width: 640px;
}

.title {
  font-size: 56px;
  line-height: 1.25;
  margin: 0 0 16px;
  font-weight: 900;
  letter-spacing: -0.5px;
  color: var(--navy);
}

.sub {
  font-size: 20px;
  margin: 0;
  color: #17233a;
  font-weight: 500;
}

/* Action Cards */
.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  max-width: 1060px;
  margin: 32px 0 32px;
}

.action-card {
  min-height: 120px;
  height: auto;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(16px);
  box-shadow: 0 10px 30px rgba(6, 28, 72, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.85);
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px 24px;
  text-decoration: none;
  color: #151d2f;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.action-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(6, 28, 72, 0.12);
  border-color: rgba(239, 35, 60, 0.4);
}

.action-card img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  transition: transform 0.3s;
}

.action-card:hover img {
  transform: scale(1.05);
}

.action-card h3 {
  font-size: 20px;
  margin: 0 0 4px;
  font-weight: 800;
  color: var(--navy);
}

.action-card p {
  font-size: 13.5px;
  margin: 0;
  color: #5c6477;
  font-weight: 500;
  line-height: 1.4;
}

.arrow {
  margin-left: auto;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.72);
  color: #092650;
  transition: var(--transition);
}

.action-card:hover .arrow {
  background: var(--red);
  color: #fff;
  transform: translateX(4px);
}

/* Stats Counter Grid */
.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}

.stat {
  height: 130px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 24px rgba(6, 28, 72, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  transition: var(--transition);
}

.stat:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(6, 28, 72, 0.1);
  background: #ffffff;
}

.stat img {
  width: 72px;
  height: 72px;
  object-fit: contain;
}

.stat h4 {
  font-size: 15px;
  margin: 0 0 2px 0;
  font-weight: 800;
  color: var(--navy);
}

.stat .num {
  font-size: 36px;
  font-weight: 900;
  line-height: 1;
  margin-bottom: 2px;
}

.stat .num.red { color: #e52236; }
.stat .num.yellow { color: #e5ab42; }
.stat .num.green { color: #21a466; }
.stat .num.blue { color: #3978be; }

.stat p {
  margin: 0;
  color: #6b7280;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
}

/* Widgets Grid Layout - 2x2 Grid for spacious readability */
.widgets {
  max-width: var(--content);
  margin: -34px auto 0;
  position: relative;
  z-index: 5;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  padding: 0 56px;
}

.panel {
  min-height: 300px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(12px);
  box-shadow: var(--soft);
  border: 1px solid rgba(255, 255, 255, 0.85);
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}

.panel-head {
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  font-weight: 900;
  color: #14234b;
}

.panel-head .left {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 17.5px;
  font-weight: 800;
}

.panel-head img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.panel-head a {
  color: var(--blue);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 700;
  transition: var(--transition);
}

.panel-head a:hover {
  color: var(--red);
}

.rows {
  padding: 14px 18px;
  flex-grow: 1;
  position: relative;
}

.row {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  gap: 9px;
  align-items: start;
  padding: 9px 0;
  font-size: 14px;
  color: #1b2944;
  border-bottom: 1px dashed var(--line);
}

.row:last-of-type {
  border-bottom: none;
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--red);
  margin-top: 7px;
}

.dot.blue { background: #3e79c2; }
.dot.yellow { background: #f0b64c; }
.dot.green { background: #22ad67; }

.row-icon {
  width: 22px;
  height: 22px;
  object-fit: contain;
  margin-top: 2px;
}

.row b {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.3;
}

.row small {
  color: #4f5a70;
  font-size: 12px;
  font-weight: 500;
  display: block;
  margin-top: 2px;
}

.empty {
  display: grid;
  place-items: center;
  min-height: 170px;
  text-align: center;
  color: #74809a;
  font-size: 16px;
}

.cardrow {
  background: rgba(248, 250, 254, 0.92);
  border-radius: 14px;
  margin: 8px 0;
  padding: 12px;
  font-weight: 700;
}

.panel-illustration {
  position: absolute;
  right: 12px;
  bottom: 44px;
  width: 105px;
  height: 105px;
  object-fit: contain;
  pointer-events: none;
  opacity: 0.06; /* Lowered opacity to prevent overlap with text */
}

.see {
  position: absolute;
  bottom: 18px;
  left: 18px;
  color: var(--red);
  text-decoration: none;
  font-size: 15px;
  font-weight: 700;
  transition: var(--transition);
}

.see:hover {
  text-decoration: underline;
}

/* Toast Messages */
.toastbox {
  position: fixed;
  right: 22px;
  top: 108px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  min-width: 300px;
  max-width: 420px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-left: 5px solid var(--red);
  box-shadow: 0 15px 40px rgba(6, 28, 72, 0.16);
  border-radius: 16px;
  padding: 14px 18px;
  color: #091f49;
  font-weight: 700;
  backdrop-filter: blur(14px);
  font-size: 14.5px;
}

@keyframes pulse {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 35, 60, 0.45); }
  55% { transform: scale(1.14); box-shadow: 0 0 0 16px rgba(239, 35, 60, 0); }
  100% { transform: scale(1); box-shadow: none; }
}

.bell.pulse {
  animation: pulse 0.8s ease-in-out 3;
}

/* Iframe Modal for Ivanti Forms & Details */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(10, 34, 64, 0.6);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  display: flex;
  opacity: 1;
}

.modal-container {
  width: 90%;
  max-width: 1200px;
  height: 85%;
  background-color: white;
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(20px);
  transition: transform 0.3s ease;
}

.modal-overlay.active .modal-container {
  transform: translateY(0);
}

.modal-header {
  height: 60px;
  background-color: var(--navy);
  color: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}

.modal-title {
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-close-btn {
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  padding: 6px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.modal-close-btn:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.modal-close-btn svg {
  width: 24px;
  height: 24px;
}

.modal-body {
  flex-grow: 1;
  position: relative;
  background-color: #F8FAFC;
}

.modal-iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.iframe-loader {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  color: var(--navy);
  font-weight: 700;
}

.loader-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(6, 41, 90, 0.1);
  border-left-color: var(--red);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* Simulation Notice/Alert Banner */
.sim-banner {
  background-color: #FFFDF5;
  border: 1px solid #FBE3B3;
  color: #8A6D3B;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  margin: 20px 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 500;
}

.sim-btn-group {
  display: flex;
  gap: 12px;
}

.sim-btn {
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid #D6E9C6;
  background-color: #DFF0D8;
  color: #3C763D;
  transition: var(--transition);
}

.sim-btn:hover {
  background-color: #D0E9C6;
}

.error-banner {
  background-color: #FEF2F2;
  border: 1px solid #FCA5A5;
  color: #991B1B;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  margin: 20px 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
}

/* My Requests Details Modal Styles */
.filter-tab-group {
  display: flex;
  background-color: #EDF2F7;
  padding: 4px;
  border-radius: var(--radius-sm);
  gap: 4px;
}

.filter-tab-btn {
  border: none;
  background: none;
  padding: 8px 16px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition);
}

.filter-tab-btn:hover {
  color: var(--navy);
}

.filter-tab-btn.active {
  background-color: #ffffff;
  color: var(--navy);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

#status-filter-group .filter-tab-btn.active {
  color: var(--red);
}

.table-responsive-container {
  overflow-x: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background-color: #ffffff;
}

.tickets-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 14px;
}

.tickets-table th {
  background-color: #F8FAFC;
  color: var(--navy);
  padding: 14px 18px;
  font-weight: 800;
  border-bottom: 2px solid var(--border-color);
}

.tickets-table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-color);
  color: var(--ink);
}

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

.tickets-table tbody tr:hover {
  background-color: #F8FAFC;
}

.no-tickets-fallback {
  text-align: center;
  padding: 40px;
  color: var(--muted);
  font-size: 14.5px;
  font-weight: 500;
  display: none;
}

.badge-ticket-type {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  text-transform: uppercase;
}

.type-incident {
  background-color: rgba(239, 35, 60, 0.1);
  color: var(--red);
}

.type-service {
  background-color: rgba(31, 95, 189, 0.1);
  color: var(--blue);
}

/* Status Badges */
.incident-status {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  display: inline-block;
}
.status-completed {
  background-color: #D1FAE5;
  color: #065F46;
}
.status-pending {
  background-color: #FEF3C7;
  color: #92400E;
}
.status-in-progress {
  background-color: #DBEAFE;
  color: #1E40AF;
}

/* Enterprise Login Screen Overlay */
.login-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(6, 41, 90, 0.85);
  backdrop-filter: blur(8px);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.login-overlay.active {
  display: flex;
  opacity: 1;
}

.login-box {
  background-color: #ffffff;
  border-radius: var(--radius-lg);
  padding: 40px;
  width: 90%;
  max-width: 460px;
  text-align: center;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transform: translateY(20px);
  transition: transform 0.4s ease;
}

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

.login-box h2 {
  font-size: 22px;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 12px;
}

.login-submit-btn {
  width: 100%;
  background-color: var(--red);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  padding: 14px 20px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  box-shadow: 0 4px 12px rgba(239, 35, 60, 0.2);
}

.login-submit-btn:hover {
  background-color: #d91c36;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(239, 35, 60, 0.3);
}

.login-help-text {
  margin-top: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Draggable & Resizable Floating Window for AI Virtual Agent */
.draggable-window {
  display: none;
  position: fixed;
  top: 100px;
  right: 40px;
  width: 400px;
  height: 600px;
  z-index: 1000;
  box-shadow: 0 15px 45px rgba(6, 28, 72, 0.16);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #ffffff;
  border: 1px solid var(--border-color);
  flex-direction: column;
}

.window-header {
  background-color: var(--navy);
  color: white;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: move;
  font-size: 15px;
  font-weight: 700;
  user-select: none;
}

.resize-handle {
  position: absolute;
  z-index: 1001;
}

.resize-handle.se {
  right: 0;
  bottom: 0;
  width: 14px;
  height: 14px;
  cursor: se-resize;
  background-image: linear-gradient(135deg, transparent 50%, var(--muted) 50%);
  background-size: 6px 6px;
  background-repeat: no-repeat;
  background-position: bottom right 3px;
}

.resize-handle.s {
  left: 0;
  right: 14px;
  bottom: 0;
  height: 8px;
  cursor: s-resize;
}

.resize-handle.e {
  top: 0;
  bottom: 14px;
  right: 0;
  width: 8px;
  cursor: e-resize;
}

/* Responsive details */
@media(max-width: 1300px) {
  :root {
    --side: 200px;
  }
  .nav a {
    font-size: 13px;
    padding: 0 14px;
    gap: 10px;
    margin: 0 8px;
  }
  .hero {
    padding-left: 36px;
    padding-right: 36px;
  }
  .widgets {
    padding: 0 36px;
    grid-template-columns: repeat(2, 1fr);
  }
  .stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .actions {
    max-width: 820px;
  }
  .title {
    font-size: 44px;
  }
  .sim-banner, .error-banner {
    margin: 20px 36px;
  }
}

@media (max-width: 768px) {
  .app {
    grid-template-columns: 1fr;
  }
  .sidebar {
    display: none; /* Hide sidebar in mobile view */
  }
  .topbar {
    grid-column: 1;
    padding: 0 20px;
  }
  .logo {
    min-width: unset;
  }
  .page {
    grid-column: 1;
  }
  .widgets {
    grid-template-columns: 1fr;
  }
  .stats {
    grid-template-columns: 1fr;
  }
  .actions {
    grid-template-columns: 1fr;
    max-width: 100%;
  }
}

@media (max-width: 500px) {
  .draggable-window {
    width: calc(100vw - 32px) !important;
    height: 500px !important;
    top: 80px !important;
    right: 16px !important;
    left: 16px !important;
  }
}

/* Bell Dropdown Styling */
.bell-dropdown {
  position: absolute;
  top: 54px;
  right: -100px;
  width: 360px;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 30px rgba(6, 28, 72, 0.15);
  display: none; /* Toggled via JS */
  flex-direction: column;
  z-index: 1000;
  overflow: hidden;
  animation: slideDown 0.2s ease-out;
  text-align: left;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.bell-dropdown-header {
  padding: 12px 16px;
  font-weight: 800;
  color: var(--navy);
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  background-color: #F8FAFC;
}

.bell-dropdown-body {
  max-height: 320px;
  overflow-y: auto;
}

.bell-dropdown-item {
  padding: 12px 16px;
  border-bottom: 1px dashed var(--line);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: default;
}

.bell-dropdown-item:last-child {
  border-bottom: none;
}

.bell-dropdown-item:hover {
  background-color: rgba(248, 250, 254, 0.7);
}

.bell-dropdown-item-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.4;
  display: block;
}

.bell-dropdown-item-meta {
  font-size: 11px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.bell-dropdown-item-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 4px;
}

.bell-quick-btn {
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid var(--border-color);
  background: white;
  color: var(--navy);
  transition: var(--transition);
  font-family: inherit;
}

.bell-quick-btn.approve {
  background-color: #C6F6D5;
  color: #22543D;
  border-color: #9AE6B4;
}

.bell-quick-btn.approve:hover {
  background-color: #A3F4B9;
}

.bell-quick-btn.detail {
  background-color: var(--navy);
  color: white;
  border-color: var(--navy);
}

.bell-quick-btn.detail:hover {
  background-color: var(--navy2);
}

.bell-dropdown-footer {
  padding: 10px;
  text-align: center;
  border-top: 1px solid var(--line);
  background-color: #F8FAFC;
}

.bell-dropdown-footer a {
  font-size: 12.5px;
  color: var(--blue);
  text-decoration: none;
  font-weight: 700;
}

.bell-dropdown-footer a:hover {
  color: var(--red);
  text-decoration: underline;
}

/* Search Autocomplete Results Dropdown Popover */
.search-results-dropdown {
  position: absolute;
  top: 54px;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 560px;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: 0 15px 45px rgba(6, 28, 72, 0.18);
  display: none; /* Toggled via JS */
  flex-direction: column;
  z-index: 999;
  max-height: 480px;
  overflow-y: auto;
  text-align: left;
}

.search-results-group {
  padding: 8px 0;
}

.search-results-group-title {
  padding: 6px 16px;
  font-size: 11.5px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--muted);
  background-color: #F8FAFC;
  border-bottom: 1px solid var(--line);
  border-top: 1px solid var(--line);
  letter-spacing: 0.5px;
}

.search-results-group:first-child .search-results-group-title {
  border-top: none;
}

.search-results-item {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: var(--transition);
  border-bottom: 1px solid rgba(0, 0, 0, 0.02);
}

.search-results-item:last-child {
  border-bottom: none;
}

.search-results-item:hover {
  background-color: rgba(248, 250, 254, 0.9);
}

.search-results-item-icon {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  background-color: #EFF6FF;
  color: var(--blue);
  flex-shrink: 0;
  font-size: 15px;
}

.search-results-item.kb .search-results-item-icon {
  background-color: #FFFDF5;
  color: #E5AB42;
}

.search-results-item-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.search-results-item-name {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.4;
}

.search-results-item-desc {
  font-size: 11.5px;
  color: var(--muted);
}

.search-results-empty {
  padding: 30px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
}

/* Service Catalog Grid & Card Styles */
.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
  width: 100%;
}

.catalog-card-item {
  background: #ffffff;
  border: 1px solid #E5E7EB;
  border-radius: 12px;
  padding: 20px;
  cursor: pointer;
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.01);
}

.catalog-card-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(6, 28, 72, 0.08);
}

/* Category-specific border highlights on hover */
.catalog-card-item:hover:has(.cat-database) { border-color: #BFDBFE; }
.catalog-card-item:hover:has(.cat-qa) { border-color: #DDD6FE; }
.catalog-card-item:hover:has(.cat-security) { border-color: #99F6E4; }
.catalog-card-item:hover:has(.cat-hr) { border-color: #FDE68A; }
.catalog-card-item:hover:has(.cat-hardware) { border-color: #A7F3D0; }
.catalog-card-item:hover:has(.cat-email) { border-color: #FED7AA; }
.catalog-card-item:hover:has(.cat-network) { border-color: #C7D2FE; }
.catalog-card-item:hover:has(.cat-software) { border-color: #BFDBFE; }
.catalog-card-item:hover:has(.cat-default) { border-color: #FECDD3; }

.catalog-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 20px;
  transition: all 0.2s ease;
}

/* Category icon colors & backgrounds */
.catalog-card-icon.cat-database { background-color: #EFF6FF; color: #2563EB; }
.catalog-card-icon.cat-qa { background-color: #F5F3FF; color: #7C3AED; }
.catalog-card-icon.cat-security { background-color: #F0FDFA; color: #0D9488; }
.catalog-card-icon.cat-hr { background-color: #FEF3C7; color: #D97706; }
.catalog-card-icon.cat-hardware { background-color: #ECFDF5; color: #059669; }
.catalog-card-icon.cat-email { background-color: #FFF7ED; color: #EA580C; }
.catalog-card-icon.cat-network { background-color: #EEF2FF; color: #4F46E5; }
.catalog-card-icon.cat-software { background-color: #EFF6FF; color: #3B82F6; }
.catalog-card-icon.cat-default { background-color: #FFF1F2; color: var(--thp-red); }

.catalog-card-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.catalog-card-title {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.4;
}

.catalog-card-desc {
  font-size: 12px;
  color: #6b7280;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.catalog-card-action {
  font-size: 12px;
  font-weight: 700;
  color: var(--thp-red);
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: auto;
}

.catalog-card-action svg {
  transition: transform 0.2s;
}

.catalog-card-item:hover .catalog-card-action svg {
  transform: translateX(3px);
}

/* Ticket Detail Modal Styles */
.ticket-detail-layout {
  display: grid;
  grid-template-columns: 350px 1fr;
  gap: 24px;
  height: calc(100% - 110px);
  overflow: hidden;
}

@media (max-width: 768px) {
  .ticket-detail-layout {
    grid-template-columns: 1fr;
    overflow-y: auto;
  }
}

.ticket-detail-summary-pane {
  border-right: 1px solid #E5E7EB;
  padding-right: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
}

@media (max-width: 768px) {
  .ticket-detail-summary-pane {
    border-right: 0;
    border-bottom: 1px solid #E5E7EB;
    padding-right: 0;
    padding-bottom: 24px;
    overflow-y: visible;
  }
}

.ticket-detail-comm-pane {
  display: flex;
  flex-direction: column;
  gap: 16px;
  height: 100%;
  overflow: hidden;
}

.detail-section-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--navy);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
  margin-top: 10px;
  border-bottom: 2px solid #F3F4F6;
  padding-bottom: 6px;
}

.detail-info-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.detail-info-label {
  font-size: 11.5px;
  color: #6B7280;
  font-weight: 600;
}

.detail-info-value {
  font-size: 13.5px;
  color: #1F2937;
  font-weight: 500;
}

/* Chat/Notes History */
.notes-history-container {
  flex: 1;
  border: 1px solid #E5E7EB;
  border-radius: 12px;
  background-color: #F9FAFB;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.note-bubble {
  max-width: 85%;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.note-bubble.analyst {
  align-self: flex-start;
  background-color: #FFFFFF;
  border: 1px solid #E5E7EB;
  border-top-left-radius: 2px;
}

.note-bubble.user {
  align-self: flex-end;
  background-color: #FFF1F2;
  border: 1px solid #FECDD3;
  border-top-right-radius: 2px;
  color: #374151;
}

.note-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 10.5px;
  font-weight: 700;
  color: #9CA3AF;
  border-bottom: 1px dashed rgba(0, 0, 0, 0.06);
  padding-bottom: 4px;
}

.note-header.analyst-header {
  color: var(--thp-blue);
}

.note-header.user-header {
  color: var(--thp-red);
}

.note-time {
  font-weight: 500;
  color: #9CA3AF;
}

.note-message {
  white-space: pre-wrap;
  color: #374151;
}

/* Notes Form */
.note-input-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-top: 1px solid #E5E7EB;
  padding-top: 12px;
}

.note-textarea {
  width: 100%;
  height: 65px;
  border: 1px solid #D1D5DB;
  border-radius: 8px;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 13px;
  resize: none;
  outline: none;
  transition: border-color 0.2s;
}

.note-textarea:focus {
  border-color: var(--thp-red);
}

.note-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.attachment-btn-wrapper {
  position: relative;
  overflow: hidden;
  display: inline-block;
}

.attachment-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background-color: #F3F4F6;
  border: 1px solid #D1D5DB;
  color: #374151;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.attachment-btn:hover {
  background-color: #E5E7EB;
  border-color: #9CA3AF;
}

.attachment-btn input[type="file"] {
  position: absolute;
  left: 0;
  top: 0;
  opacity: 0;
  font-size: 100px;
  cursor: pointer;
}

.selected-file-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background-color: #EFF6FF;
  border: 1px solid #BFDBFE;
  color: #2563EB;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  max-width: 180px;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.send-note-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background-color: var(--thp-red);
  border: 0;
  color: #FFFFFF;
  padding: 9px 18px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.send-note-btn:hover {
  background-color: var(--thp-red-hover);
  transform: translateY(-1px);
}

.note-bubble-attachments {
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-top: 1px dashed rgba(0, 0, 0, 0.05);
  padding-top: 6px;
}

.note-attachment-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: #2563EB;
  text-decoration: none;
  font-weight: 600;
}

.note-attachment-item:hover {
  text-decoration: underline;
}

/* Make table rows clickable and style them nicely */
#modal-tickets-tbody tr {
  cursor: pointer;
  transition: background-color 0.2s ease;
}

#modal-tickets-tbody tr:hover {
  background-color: #FFF1F2;
}

/* Stepper Progress Tracker Graphic Styles */
.ticket-status-stepper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  background: #FFFFFF;
  padding: 16px 24px;
  border-radius: 12px;
  border: 1px solid #E5E7EB;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.stepper-progress-bg {
  position: absolute;
  top: 32px; /* vertically aligns with the center of bubbles */
  left: 12.5%;
  right: 12.5%;
  height: 4px;
  background-color: #E5E7EB;
  z-index: 1;
}

.stepper-progress-fill {
  position: absolute;
  top: 32px;
  left: 12.5%;
  width: 0%; /* Dynamically updated via JS */
  height: 4px;
  background-color: var(--thp-red);
  z-index: 1;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.stepper-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  position: relative;
  z-index: 2;
  flex: 1;
}

.stepper-bubble {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: #FFFFFF;
  border: 3px solid #E5E7EB;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  color: #9CA3AF;
  transition: all 0.3s ease;
}

.stepper-bubble svg {
  display: none;
}

.stepper-label {
  font-size: 12px;
  font-weight: 600;
  color: #6B7280;
  transition: all 0.3s ease;
  text-align: center;
}

/* Stepper States: Active (Current) */
.stepper-step.active .stepper-bubble {
  border-color: var(--thp-red);
  background-color: #FFFFFF;
  color: var(--thp-red);
  box-shadow: 0 0 0 4px #FFE4E6;
}

.stepper-step.active .stepper-label {
  color: var(--navy);
  font-weight: 700;
}

/* Stepper States: Completed */
.stepper-step.completed .stepper-bubble {
  border-color: var(--thp-red);
  background-color: var(--thp-red);
  color: #FFFFFF;
}

.stepper-step.completed .stepper-bubble svg {
  display: block;
}

.stepper-step.completed .stepper-bubble span {
  display: none;
}

.stepper-step.completed .stepper-label {
  color: var(--thp-red);
  font-weight: 700;
}

.header-logout-btn {
  background: #FEF2F2;
  border: 1px solid #FCA5A5;
  color: var(--danger);
  padding: 6px 12px;
  border-radius: 6px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  height: 36px;
  transition: var(--transition);
}

/* Header Logout Button Interactive Styles */
.header-logout-btn:hover {
  background-color: #FEE2E2 !important;
  border-color: var(--danger) !important;
  color: var(--thp-red) !important;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(239, 68, 68, 0.12);
}

.header-logout-btn:active {
  transform: translateY(0);
  box-shadow: none;
}
