/* ==========================================================
   Modern SaaS Design System (Plus Jakarta Sans + Inter)
   Refined Light / Dark Theme, Glassmorphism, Micro-animations
   ========================================================== */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@500;600&display=swap');

:root {
  --navy: #0F172A;
  --navy-2: #1E293B;
  --navy-3: #334155;
  --blue: #2563EB;
  --blue-hover: #1D4ED8;
  --blue-light: rgba(37, 99, 235, 0.1);
  --cyan: #06B6D4;
  --amber: #F59E0B;
  --red: #EF4444;
  --green: #10B981;
  --purple: #8B5CF6;
  
  --bg: #F8FAFC;
  --surface: #FFFFFF;
  --surface-hover: #F1F5F9;
  --border: #E2E8F0;
  --border-light: #F1F5F9;
  --text: #0F172A;
  --text-muted: #64748B;
  --text-light: #94A3B8;
  
  --font-heading: 'Plus Jakarta Sans', -apple-system, sans-serif;
  --font-body: 'Inter', -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --radius-full: 9999px;
  
  --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
  
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

html[data-theme="dark"] {
  --bg: #0B0F17;
  --surface: #131B26;
  --surface-hover: #1E293B;
  --border: #222F3E;
  --border-light: #1A2433;
  --text: #F1F5F9;
  --text-muted: #94A3B8;
  --text-light: #64748B;
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 10px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.5);
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  box-sizing: border-box;
}
*, *::before, *::after {
  box-sizing: border-box;
}
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  font-size: 13.5px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; transition: var(--transition); }
h1, h2, h3, h4, h5, h6 { font-family: var(--font-heading); font-weight: 700; margin: 0 0 8px; color: var(--text); letter-spacing: -0.02em; }
.page-wrap { padding: 24px; max-width: 1240px; margin: 0 auto; min-height: calc(100vh - 120px); }
@media (max-width: 768px) { .page-wrap { padding: 14px 10px; } }

/* ==========================================================
   Auth Layout (Login / Register) - Clean & Centered Box
   ========================================================== */
.auth-bg {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 24px 16px;
}
.auth-wrap {
  width: 100%;
  max-width: 440px;
  margin: auto;
}
.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  box-shadow: var(--shadow-lg);
}

/* ==========================================================
   Navbar & Notifications Header
   ========================================================== */
.navbar {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 100%);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(8px);
}
.navbar-inner {
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
  padding: 0 20px;
  height: 60px;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  position: relative;
  box-sizing: border-box;
}
.navbar-brand-wrap {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #FFFFFF !important;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.01em;
  text-decoration: none;
}
.brand:hover { opacity: 0.95; }
.brand-logo { width: 32px; height: 32px; border-radius: 8px; object-fit: cover; box-shadow: 0 2px 6px rgba(0,0,0,0.2); }
.brand-logo-fallback {
  width: 32px; height: 32px; border-radius: 8px;
  background: linear-gradient(135deg, #3B82F6, #1D4ED8);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 13px; box-shadow: 0 2px 8px rgba(37, 99, 235, 0.4);
}

/* Rematrix brand logo theme contrast */
.rematrix-brand-logo {
  display: inline-block;
  vertical-align: middle;
  transition: color var(--transition);
}
.navbar .rematrix-brand-logo {
  color: #FFFFFF !important;
}
.auth-card .rematrix-brand-logo,
.pricing-nav .rematrix-brand-logo {
  color: var(--text);
}

.navlinks {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: nowrap;
  flex: 1;
  margin-left: 8px;
  white-space: nowrap;
}
.navbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-shrink: 0;
  height: 36px;
}
.navlink {
  color: rgba(255, 255, 255, 0.85);
  font-size: 13px;
  font-weight: 500;
  height: 36px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
  box-sizing: border-box;
  vertical-align: middle;
}
.navlink:hover { color: #fff; background: rgba(255, 255, 255, 0.12); }
.navlink.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.18);
  font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22);
}
.nav-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  font-size: 12.5px;
  font-weight: 700;
  color: #FFFFFF !important;
  background: linear-gradient(135deg, #2563EB 0%, #1D4ED8 100%);
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
  white-space: nowrap;
  text-decoration: none;
  transition: var(--transition);
  box-sizing: border-box;
  flex-shrink: 0;
  vertical-align: middle;
}
.nav-action-btn:hover {
  background: linear-gradient(135deg, #1D4ED8 0%, #1E40AF 100%);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.5);
  transform: translateY(-1px);
  color: #FFFFFF !important;
}
@media (max-width: 1180px) {
  .nav-action-btn span {
    display: none;
  }
  .nav-action-btn {
    padding: 0;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    justify-content: center;
  }
}
@media (max-width: 768px) {
  .nav-action-btn {
    display: none;
  }
}

.user-chip,
.navlink.user-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 36px;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 18px;
  font-size: 12.5px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #FFFFFF !important;
  text-decoration: none;
  box-sizing: border-box;
  flex-shrink: 0;
  transition: var(--transition);
  vertical-align: middle;
  box-shadow: none;
}
.user-chip:hover,
.navlink.user-chip:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #FFFFFF !important;
  border-color: rgba(255, 255, 255, 0.35);
  box-shadow: none;
}
.user-chip-name {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.navlink-dropdown {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  height: 36px;
}
.dropdown-menu {
  display: none;
  position: absolute;
  left: 0;
  top: 100%;
  margin-top: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px;
  min-width: 210px;
  box-shadow: var(--shadow-xl);
  z-index: 120;
  animation: dropdownFadeIn 0.15s ease-out;
}
/* Invisible hover bridge ensuring mouse transition never drops hover state */
.dropdown-menu::before {
  content: '';
  position: absolute;
  top: -12px;
  left: 0;
  right: 0;
  height: 14px;
  background: transparent;
}
.navlinks > .navlink-dropdown:last-child .dropdown-menu,
.navbar-actions .dropdown-menu {
  left: auto;
  right: 0;
}
.navlink-dropdown:hover > .dropdown-menu,
.navlink-dropdown:focus-within > .dropdown-menu,
.navlink-dropdown.js-open > .dropdown-menu {
  display: block;
}
.dropdown-menu a.navlink {
  color: var(--text) !important;
}

.dropdown-menu a.navlink.active {
  color: #fff;
}

.dropdown-menu a {
  display: block;
  width: 100%;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text);
  font-weight: 500;
  text-align: left;
  transition: var(--transition);
  text-decoration: none;
}

.dropdown-menu a.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.18);
  font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22);
}
.dropdown-menu a:hover { background: var(--surface-hover); color: var(--blue); }
.dropdown-role {
  display: block;
  padding: 6px 12px 4px;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
}
.theme-toggle {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  box-sizing: border-box;
  flex-shrink: 0;
}
.theme-toggle:hover {
  background: rgba(255, 255, 255, 0.22);
  color: #FBBF24;
  transform: rotate(15deg);
}

/* Plan Row Styling */
.plan-row {
  background: var(--bg);
  transition: var(--transition);
}
.plan-row:hover {
  background: var(--surface-hover);
}
.plan-badge {
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 600;
  margin-left: 6px;
}
.plan-badge.basic { background: #E0F2FE; color: #0284C7; }
.plan-badge.pro { background: #FCE7F3; color: #C026D3; }
.plan-badge.business { background: #FEF3C7; color: #D97706; }

/* Bell Notification Button & Dropdown */
.notif-bell {
  position: relative;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  box-sizing: border-box;
  flex-shrink: 0;
}
.notif-bell:hover {
  background: rgba(255, 255, 255, 0.22);
  color: #38BDF8;
}
.notif-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  background: #EF4444;
  color: #fff;
  font-size: 9.5px;
  font-weight: 700;
  min-width: 17px;
  height: 17px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 2px solid var(--navy);
  box-shadow: 0 2px 4px rgba(0,0,0,0.25);
  box-sizing: border-box;
}

/* Notification Dropdown Container */
.notif-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 340px;
  max-width: calc(100vw - 32px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.25);
  z-index: 200;
  overflow: hidden;
  animation: dropdownFadeIn 0.15s ease-out;
}
.notif-dropdown.open {
  display: block;
}
.notif-dropdown a.notif-item {
  display: block;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
  font-size: 12.5px;
  line-height: 1.45;
  transition: background 0.15s ease;
}
.notif-dropdown a.notif-item:last-child {
  border-bottom: none;
}
.notif-dropdown a.notif-item:hover {
  background: var(--surface-hover);
  color: var(--blue);
}
.notif-dropdown a.notif-item.unread {
  background: rgba(37, 99, 235, 0.07);
  font-weight: 600;
  border-left: 3px solid var(--blue);
}
.notif-time {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 3px;
  font-weight: normal;
}
.notif-empty {
  padding: 28px 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 12.5px;
}

.mobile-user-section { display: none; }
.nav-toggle {
  display: none;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
  font-size: 15px;
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  box-sizing: border-box;
  flex-shrink: 0;
}
.nav-toggle:hover { background: rgba(255, 255, 255, 0.22); }

@media (max-width: 1180px) {
  .nav-toggle { display: inline-flex; }
  .desktop-user-chip { display: none !important; }
  .mobile-user-section { display: block; }
  .navlinks {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--navy);
    padding: 14px 20px;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 110;
  }
  .navlinks.open { display: flex; }
  .navlinks .navlink { width: 100%; padding: 10px 14px; }
  .navlinks .dropdown-menu {
    position: static;
    width: 100%;
    box-shadow: none;
    background: rgba(0, 0, 0, 0.25);
    margin-top: 4px;
    border-color: rgba(255, 255, 255, 0.12);
  }
  .navlinks .dropdown-menu a { color: rgba(255, 255, 255, 0.9); }
  .navlinks .dropdown-menu a:hover { background: rgba(255, 255, 255, 0.1); color: #38BDF8; }
}

/* ==========================================================
   Cards & Stats
   ========================================================== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  overflow: hidden;
}
.card:hover { border-color: rgba(37, 99, 235, 0.2); }
.card-head {
  padding: 13px 18px;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--surface);
}
.card-body { padding: 18px; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
@media (max-width: 900px) { .stats { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 540px) { .stats { grid-template-columns: 1fr; } }
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--blue);
  border-radius: var(--radius);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}
.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat.amber { border-left-color: var(--amber); }
.stat.green { border-left-color: var(--green); }
.stat.red { border-left-color: var(--red); }
.stat.purple { border-left-color: var(--purple); }

.stat-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(37, 99, 235, 0.1);
  color: var(--blue);
  font-size: 17px;
  flex-shrink: 0;
}
.stat.amber .stat-icon { background: rgba(245, 158, 11, 0.12); color: var(--amber); }
.stat.green .stat-icon { background: rgba(16, 185, 129, 0.12); color: var(--green); }
.stat.red .stat-icon { background: rgba(239, 68, 68, 0.12); color: var(--red); }
.stat.purple .stat-icon { background: rgba(139, 92, 246, 0.12); color: var(--purple); }

.stat-num { font-family: var(--font-heading); font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.stat-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; margin-top: 2px; }

/* ==========================================================
   Tables
   ========================================================== */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 13px; text-align: left; }
thead th {
  background: var(--surface);
  padding: 11px 14px;
  color: var(--text-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .05em;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
tbody td { padding: 11px 14px; border-top: 1px solid var(--border-light); color: var(--text); vertical-align: middle; }
tbody tr:hover { background: var(--surface-hover); }
tbody tr.clickable { cursor: pointer; }
.mono { font-family: var(--font-mono); font-size: 12px; }

/* ==========================================================
   Badges
   ========================================================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  line-height: 1.4;
}
.badge-low { background: #E2E8F0; color: #475569; }
html[data-theme=dark] .badge-low { background: #1E293B; color: #94A3B8; }
.badge-medium { background: rgba(37, 99, 235, 0.12); color: var(--blue); }
.badge-high { background: rgba(245, 158, 11, 0.15); color: #B45309; }
html[data-theme=dark] .badge-high { color: #FBBF24; }
.badge-urgent { background: rgba(239, 68, 68, 0.12); color: var(--red); }
.badge-new { background: #E2E8F0; color: #475569; }
html[data-theme=dark] .badge-new { background: #1E293B; color: #94A3B8; }
.badge-open { background: rgba(37, 99, 235, 0.12); color: var(--blue); }
.badge-progress { background: rgba(139, 92, 246, 0.14); color: var(--purple); }
.badge-pending { background: rgba(245, 158, 11, 0.15); color: #B45309; }
html[data-theme=dark] .badge-pending { color: #FBBF24; }
.badge-hold { background: rgba(139, 92, 246, 0.14); color: var(--purple); }
.badge-resolved { background: rgba(16, 185, 129, 0.14); color: var(--green); }
.badge-closed { background: #E2E8F0; color: #475569; }
html[data-theme=dark] .badge-closed { background: #1E293B; color: #94A3B8; }
.badge-reopened { background: rgba(239, 68, 68, 0.12); color: var(--red); }
.badge-outline { background: transparent; border: 1px solid var(--border); color: var(--text-muted); }

/* ==========================================================
   Buttons & Form Controls
   ========================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn:active { transform: translateY(0); }

.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-hover); color: #fff; box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3); }
.btn-outline { background: var(--surface); border-color: var(--border); color: var(--text); }
.btn-outline:hover { background: var(--surface-hover); border-color: var(--text-muted); }
.btn-secondary { background: var(--navy-2); color: #fff; }
.btn-secondary:hover { background: var(--navy); color: #fff; }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #DC2626; box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3); }
.btn-success { background: var(--green); color: #fff; }
.btn-success:hover { background: #059669; box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3); }
.btn-sm { padding: 5px 10px; font-size: 12px; border-radius: var(--radius-sm); }
.btn-block { width: 100%; }

.form-control, .form-select, textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  transition: var(--transition);
  box-shadow: var(--shadow-xs);
}
.form-control:focus, .form-select:focus, textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
.form-control-sm, .form-select-sm { padding: 5px 8px; font-size: 12px; }
input[type="date"] { cursor: pointer; }
label { display: block; font-size: 12px; font-weight: 600; margin-bottom: 5px; color: var(--text-muted); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 640px) { .form-row { grid-template-columns: 1fr; } }

/* Filter Reset Button */
.filter-reset-btn {
  color: var(--red);
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: var(--radius-sm);
  padding: 6px 11px;
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: var(--transition);
  text-decoration: none;
}
.filter-reset-btn:hover {
  background: rgba(239, 68, 68, 0.18);
  color: #DC2626;
}

/* Alerts */
.alert { padding: 11px 15px; border-radius: var(--radius-sm); font-size: 13px; margin-bottom: 14px; display: flex; align-items: flex-start; gap: 10px; }
.alert-danger { background: rgba(239, 68, 68, 0.08); color: #B91C1C; border: 1px solid rgba(239, 68, 68, 0.25); }
html[data-theme=dark] .alert-danger { color: #FCA5A5; }
.alert-success { background: rgba(16, 185, 129, 0.08); color: #047857; border: 1px solid rgba(16, 185, 129, 0.25); }
html[data-theme=dark] .alert-success { color: #6EE7B7; }
.alert-warning { background: rgba(245, 158, 11, 0.08); color: #B45309; border: 1px solid rgba(245, 158, 11, 0.25); }
html[data-theme=dark] .alert-warning { color: #FDE68A; }
.alert-info { background: rgba(37, 99, 235, 0.08); color: #1D4ED8; border: 1px solid rgba(37, 99, 235, 0.25); }
html[data-theme=dark] .alert-info { color: #93C5FD; }

/* ==========================================================
/* ==========================================================
   Conversation & Chat Thread (Tickets View) - Modern Executive UI
   ========================================================== */
.thread { display: flex; flex-direction: column; gap: 18px; padding: 12px 0; }
.chat-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
  width: 100%;
}
.chat-row-left {
  justify-content: flex-start;
  flex-direction: row;
}
.chat-row-right {
  justify-content: flex-end;
  flex-direction: row;
}

.chat-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
  user-select: none;
}

.chat-bubble {
  max-width: 80%;
  padding: 13px 18px;
  border-radius: 16px;
  position: relative;
  font-size: 14px;
  line-height: 1.6;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  background: var(--bubble-light, var(--surface));
  border: 1px solid var(--border);
  color: var(--text);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.chat-bubble:hover {
  box-shadow: 0 4px 14px rgba(0,0,0,0.08);
}

.chat-row-left .chat-bubble {
  border-top-left-radius: 4px;
  border-left: 4px solid var(--bubble-border, #2563EB);
  border-right: 1px solid var(--border);
}
.chat-row-right .chat-bubble {
  border-top-right-radius: 4px;
  border-right: 4px solid var(--bubble-border, #059669);
  border-left: 1px solid var(--border);
}

html[data-theme="dark"] .chat-bubble {
  background: var(--bubble-dark, #1E293B);
  border-color: rgba(255, 255, 255, 0.10);
  color: var(--text);
  box-shadow: 0 2px 10px rgba(0,0,0,0.25);
}
html[data-theme="dark"] .chat-bubble:hover {
  box-shadow: 0 4px 18px rgba(0,0,0,0.35);
}
html[data-theme="dark"] .chat-row-left .chat-bubble {
  border-left: 4px solid var(--bubble-border, #2563EB);
}
html[data-theme="dark"] .chat-row-right .chat-bubble {
  border-right: 4px solid var(--bubble-border, #059669);
}

.reply-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(0,0,0,0.05);
  font-size: 12.5px;
}
html[data-theme="dark"] .reply-head {
  border-bottom-color: rgba(255,255,255,0.07);
}

.reply-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 5px;
  vertical-align: middle;
}

.reply.internal {
  background: #FFFDF5;
  border: 1px solid #FDE68A;
  border-left: 4px solid #F59E0B;
  border-radius: 14px;
  padding: 14px 18px;
  margin: 6px 0;
  box-shadow: 0 2px 6px rgba(245, 158, 11, 0.05);
  color: var(--text);
}
html[data-theme="dark"] .reply.internal {
  background: #1C2333;
  border-color: #382F1D;
  border-left-color: #F59E0B;
  color: var(--text);
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}

/* ==========================================================
   Chat Thread Scroll Box (4-5 Messages Viewport)
   ========================================================== */
.thread-container-wrapper {
  position: relative;
}

.thread {
  max-height: 520px;
  min-height: 180px;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 18px;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: rgba(37, 99, 235, 0.35) transparent;
}

.thread::-webkit-scrollbar {
  width: 6px;
}
.thread::-webkit-scrollbar-track {
  background: transparent;
}
.thread::-webkit-scrollbar-thumb {
  background: rgba(37, 99, 235, 0.25);
  border-radius: 10px;
}
.thread::-webkit-scrollbar-thumb:hover {
  background: rgba(37, 99, 235, 0.5);
}

html[data-theme="dark"] .thread {
  scrollbar-color: rgba(255, 255, 255, 0.22) transparent;
}
html[data-theme="dark"] .thread::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.22);
}
html[data-theme="dark"] .thread::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.4);
}

.scroll-top-btn,
.scroll-bottom-btn {
  position: absolute;
  right: 24px;
  background: var(--surface);
  color: var(--blue);
  border: 1.5px solid var(--blue);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
  border-radius: 24px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  z-index: 10;
  opacity: 0;
  pointer-events: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.scroll-bottom-btn {
  bottom: 20px;
  transform: translateY(8px);
}

.scroll-top-btn {
  top: 65px;
  transform: translateY(-8px);
}

.scroll-bottom-btn.visible,
.scroll-top-btn.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.scroll-top-btn:hover,
.scroll-bottom-btn:hover {
  background: var(--blue);
  color: #FFFFFF;
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
}

.system-msg {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 16px 0;
  text-align: center;
}
.system-msg .line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
}
.pill {
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  letter-spacing: 0.2px;
}
.pill-resolved { background: rgba(16,185,129,0.12); color: #059669; border: 1px solid rgba(16,185,129,0.25); }
.pill-reopened { background: rgba(239,68,68,0.12); color: #DC2626; border: 1px solid rgba(239,68,68,0.25); }
html[data-theme="dark"] .pill-resolved { color: #34D399; }
html[data-theme="dark"] .pill-reopened { color: #F87171; }

.attachment-thumb {
  width: 90px;
  height: 90px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--border);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.attachment-thumb:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 16px rgba(0,0,0,0.15);
}
.unread-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--blue);
  display: inline-block;
  margin-right: 6px;
}

/* ==========================================================
   Pricing Page Cards & Grid - Modern Executive SaaS Design
   ========================================================== */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 270px), 1fr));
  gap: 24px;
  margin: 24px 0;
  align-items: stretch;
  width: 100%;
  box-sizing: border-box;
}
.price-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 18px;
  padding: 28px 22px 24px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
  text-align: center;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  box-sizing: border-box;
  overflow-wrap: break-word;
}
.price-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.08);
  border-color: var(--blue);
}
.price-card.featured {
  border: 2px solid #6366F1;
  box-shadow: 0 12px 32px rgba(99, 102, 241, 0.16), 0 2px 8px rgba(0, 0, 0, 0.04);
  background: linear-gradient(180deg, rgba(99, 102, 241, 0.05) 0%, var(--surface) 100%);
  transform: scale(1.02);
}
.price-card.featured:hover {
  transform: scale(1.02) translateY(-6px);
  box-shadow: 0 20px 45px rgba(99, 102, 241, 0.28);
  border-color: #4F46E5;
}
.price-card.featured .plan-icon-wrap {
  background: rgba(99, 102, 241, 0.14) !important;
  color: #6366F1 !important;
}
.price-card.featured .currency-symbol {
  color: #6366F1;
}
.price-card.featured .btn-primary {
  background: linear-gradient(135deg, #4F46E5 0%, #2563EB 100%);
  border: none;
  box-shadow: 0 4px 16px rgba(79, 70, 229, 0.38);
}
.price-card.featured .btn-primary:hover {
  background: linear-gradient(135deg, #4338CA 0%, #1D4ED8 100%);
  box-shadow: 0 6px 22px rgba(79, 70, 229, 0.5);
  transform: translateY(-1px);
}

/* Electric Indigo-to-Violet Gradient Badge for Popular Plan */
.plan-badge {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #4F46E5 0%, #7C3AED 55%, #EC4899 100%);
  color: #ffffff;
  padding: 5px 16px;
  border-radius: 30px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  box-shadow: 0 6px 18px rgba(79, 70, 229, 0.42);
  border: 1.5px solid rgba(255, 255, 255, 0.4);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  z-index: 5;
}
.plan-badge i {
  color: #FDE047;
  font-size: 11.5px;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.3));
}

/* Plan icon headers */
.plan-icon-wrap {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: rgba(37, 99, 235, 0.1);
  color: var(--blue);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  margin: 0 auto 12px;
  transition: var(--transition);
}
.price-card:hover .plan-icon-wrap {
  transform: scale(1.08) rotate(3deg);
}

/* Premier Rupee & Price Typography */
.price-display {
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  margin: 12px auto 2px;
  font-family: 'Plus Jakarta Sans', var(--font-heading), sans-serif;
  line-height: 1;
  text-align: center;
  position: relative;
}
.currency-symbol {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  font-size: 22px;
  font-weight: 800;
  color: var(--blue);
  margin-right: 3px;
  transform: translateY(-8px);
  display: inline-block;
  letter-spacing: -0.02em;
  opacity: 0.95;
}
html[data-theme="dark"] .currency-symbol {
  color: #38BDF8;
}
.price-number {
  font-family: 'Plus Jakarta Sans', var(--font-heading), sans-serif;
  font-size: 42px;
  font-weight: 900;
  letter-spacing: -0.045em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.price-cycle {
  font-size: 13.5px;
  color: var(--text-muted);
  font-weight: 600;
  margin-left: 5px;
}
.price-sub {
  font-size: 11.5px;
  color: var(--text-muted);
  font-weight: 500;
  margin: 0 auto 6px;
  letter-spacing: 0.01em;
}

.price-display.custom-price {
  margin: 14px auto 4px;
}
.price-custom-text {
  font-family: var(--font-heading);
  font-size: 25px;
  font-weight: 900;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, #2563EB 0%, #06B6D4 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}
html[data-theme="dark"] .price-custom-text {
  background: linear-gradient(135deg, #60A5FA 0%, #38BDF8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Asset Management inclusion badge */
.asset-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 700;
  margin: 8px auto 14px;
  width: fit-content;
  max-width: 100%;
}
.asset-pill.included {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.3);
}
html[data-theme="dark"] .asset-pill.included {
  color: #34D399;
  border-color: rgba(52, 211, 153, 0.3);
}
.asset-pill.excluded {
  background: rgba(148, 163, 184, 0.12);
  color: var(--text-muted);
  border: 1px solid var(--border);
  font-weight: 600;
}

.price-feature-checklist {
  list-style: none;
  padding: 0;
  margin: 18px 0 24px;
  text-align: left;
  font-size: 13px;
  color: var(--text);
  border-top: 1px solid var(--border);
  padding-top: 16px;
  flex: 1;
}
.price-feature-checklist li {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-bottom: 10px;
  line-height: 1.45;
}
.price-feature-checklist li i {
  margin-top: 2px;
  flex-shrink: 0;
  font-size: 13px;
}

/* ==========================================================
   Utilities & Footer
   ========================================================== */
.d-none { display: none !important; }
.d-flex { display: flex; }
.d-block { display: block; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 14px; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 14px; }
.mb-4 { margin-bottom: 20px; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 14px; }
.mt-4 { margin-top: 20px; }
.p-2 { padding: 8px; }
.p-3 { padding: 14px; }
.small { font-size: 12px; }
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.site-footer { text-align: center; padding: 24px 16px; font-size: 12px; color: var(--text-muted); }

/* ==========================================================
   Mobile Responsiveness & Lightweight Performance
   ========================================================== */
@media (max-width: 768px) {
  .pricing-hero {
    padding: 36px 18px;
  }
  .pricing-hero h1 {
    font-size: 26px !important;
  }
  .pricing-hero p {
    font-size: 14px !important;
  }
  .pricing-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .price-card.featured {
    transform: none !important;
  }
  .price-card.featured:hover {
    transform: translateY(-3px) !important;
  }
  .chat-bubble {
    max-width: 88%;
    font-size: 13.5px;
    padding: 12px 14px;
  }
  .chat-avatar {
    width: 32px;
    height: 32px;
    font-size: 12px;
  }
  .section-title {
    font-size: 22px !important;
  }
  .page-wrap {
    padding: 16px 12px 40px !important;
  }
  .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .form-control, .form-select, .btn {
    min-height: 40px;
    font-size: 14px;
  }
}
@media (max-width: 480px) {
  .chat-bubble {
    max-width: 92%;
  }
  .d-flex.justify-between {
    flex-wrap: wrap;
    gap: 8px;
  }
}
