/* ============================================
   UBIT TECHNOLOGIEZ — Ticketing System Styles
   Matches main brand: navy / gold / white
   ============================================ */

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

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

:root {
  --navy:        #0d1f3c;
  --navy-light:  #16315c;
  --navy-dark:   #08152a;
  --blue:        #2b6cb0;
  --blue-light:  #3182ce;
  --gold:        #c6923a;
  --gold-light:  #d6a14a;
  --white:       #ffffff;
  --bg:          #e8eaed;
  --bg-card:     #f0f2f5;
  --border:      #e2e8f0;
  --border-dark: #cbd5e0;
  --text:        #1a202c;
  --text-mid:    #4a5568;
  --text-light:  #718096;
  --success:     #2f855a;
  --success-bg:  #f0fff4;
  --warning:     #b7791f;
  --warning-bg:  #fffbeb;
  --danger:      #c53030;
  --danger-bg:   #fff5f5;
  --info:        #2b6cb0;
  --info-bg:     #ebf8ff;
  --radius:      12px;
  --radius-sm:   8px;
  --shadow:      0 1px 3px rgba(0,0,0,0.08), 0 4px 16px rgba(0,0,0,0.06);
  --shadow-lg:   0 8px 32px rgba(13,31,60,0.12);
  --transition:  all 0.2s ease;
}

/* ── Branded Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--navy-light); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--navy); }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.6;
/* Hide outer scrollbar globally while maintaining scroll functionality */
body, .portal-layout, .main-content, .page-body, .modal, .modal-overlay {
  -ms-overflow-style: none;  /* IE and Edge */
  scrollbar-width: none;  /* Firefox */
}
body::-webkit-scrollbar, .portal-layout::-webkit-scrollbar, .main-content::-webkit-scrollbar, .page-body::-webkit-scrollbar, .modal::-webkit-scrollbar, .modal-overlay::-webkit-scrollbar {
  display: none;
}

/* ── LAYOUT ── */
.portal-layout {
  display: flex;
  min-height: 100vh;
}

/* ── SIDEBAR — Eden-style two-panel ── */

/* Thin icon rail on the far left */
.sidebar {
  width: 260px;
  flex-shrink: 0;
  display: flex;
  flex-direction: row;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
}

/* Icon rail */
.sidebar-rail {
  width: 60px;
  background: #fff;
  border-right: 1px solid #eaecf0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 0;
  gap: 6px;
  flex-shrink: 0;
}

.sidebar-rail-logo {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: var(--navy);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px;
  flex-shrink: 0;
  overflow: hidden;
}

.sidebar-rail-logo img { width: 26px; height: 26px; object-fit: contain; filter: brightness(10); }

.rail-icon {
  width: 38px; height: 38px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; cursor: pointer;
  color: #9ca3af;
  transition: all 0.15s;
  text-decoration: none;
}

.rail-icon:hover  { background: #f3f4f6; color: var(--navy); }
.rail-icon.active { background: var(--navy); color: #fff; }

.rail-spacer { flex: 1; }

.rail-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 100%);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: var(--navy);
  cursor: pointer;
}

/* Wide expanded panel */
.sidebar-panel {
  flex: 1;
  background: #f8f9fc;
  border-right: 1px solid #eaecf0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.sidebar-logo {
  padding: 20px 18px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid #eaecf0;
  flex-shrink: 0;
}

.sidebar-logo img {
  width: 30px; height: 30px;
  border-radius: 8px;
  object-fit: contain;
  background: var(--navy);
  padding: 3px;
}

.sidebar-logo-text {
  font-family: 'Outfit', sans-serif;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.1;
}

.sidebar-logo-text .blue  { color: var(--navy); }
.sidebar-logo-text .gold  { color: var(--gold); }
.sidebar-logo-text .sub   { display: block; font-size: 9px; font-weight: 500; color: #9ca3af; letter-spacing: 1px; text-transform: uppercase; margin-top: 2px; }

/* Search bar inside panel */
.sidebar-search {
  padding: 12px 14px;
  border-bottom: 1px solid #eaecf0;
  flex-shrink: 0;
}

.sidebar-search-input {
  width: 100%;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 7px 12px;
  font-size: 12px;
  color: #374151;
  outline: none;
  display: flex; align-items: center; gap: 6px;
  cursor: text;
  font-family: 'Inter', sans-serif;
}

.sidebar-search-input::placeholder { color: #9ca3af; }

.sidebar-user {
  padding: 0;
  display: none; /* handled by rail avatar */
}

.sidebar-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 100%);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; color: var(--navy); flex-shrink: 0;
}

.sidebar-user-info { overflow: hidden; }
.sidebar-user-name { font-size: 13px; font-weight: 600; color: var(--navy); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-plan { font-size: 11px; color: var(--gold); font-weight: 600; }

/* Nav links */
.sidebar-nav { padding: 10px 10px; flex: 1; }

.sb-badge {
  width: 10px;
  height: 10px;
  background: #ff4d4d;
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(255, 77, 77, 0.5);
  animation: notificationPulse 1.5s infinite;
  display: inline-block;
  margin-left: auto;
}

.notification-dot {
  width: 8px;
  height: 8px;
  background: #ff4d4d;
  border-radius: 50%;
  display: inline-block;
  margin-right: 8px;
  box-shadow: 0 0 8px rgba(255, 77, 77, 0.6);
  animation: notificationPulse 1.5s infinite;
  vertical-align: middle;
}

@keyframes notificationPulse {
  0% { transform: scale(1); opacity: 1; box-shadow: 0 0 0 0px rgba(255, 77, 77, 0.4); }
  70% { transform: scale(1.2); opacity: 0.8; box-shadow: 0 0 0 8px rgba(255, 77, 77, 0); }
  100% { transform: scale(1); opacity: 1; box-shadow: 0 0 0 0px rgba(255, 77, 77, 0); }
}

.sb-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: rgba(255, 255, 255, 0.7); /* High contrast but subtle */
  text-decoration: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
  margin-bottom: 4px;
}

.sb-nav a:hover, .sb-nav a.active {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.sb-nav-icon {
  width: 20px;
  height: 20px;
  opacity: 0.8;
}

.sb-nav a:hover .sb-nav-icon, .sb-nav a.active .sb-nav-icon {
  opacity: 1;
}

.sidebar-nav-label {
  font-size: 10px; font-weight: 700;
  color: #9ca3af;
  letter-spacing: 1.2px; text-transform: uppercase;
  padding: 12px 8px 4px; margin-top: 4px;
}

.sidebar-nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 10px;
  color: #6b7280; text-decoration: none;
  font-size: 13px; font-weight: 500;
  transition: all 0.15s; margin-bottom: 1px;
  position: relative;
}

.sidebar-nav a:hover  { background: #fff; color: var(--navy); box-shadow: 0 1px 4px rgba(0,0,0,0.06); }
.sidebar-nav a.active { background: var(--navy); color: #fff; box-shadow: 0 2px 8px rgba(13,31,60,0.2); }
.sidebar-nav a.active .nav-icon { filter: none; }
.sidebar-nav a .nav-icon { font-size: 15px; width: 18px; text-align: center; }
.sidebar-nav a .badge {
  margin-left: auto; background: var(--gold);
  color: var(--navy); font-size: 10px; font-weight: 700;
  padding: 1px 7px; border-radius: 20px;
}

/* Bottom user footer in panel */
.sidebar-footer {
  padding: 14px 14px;
  border-top: 1px solid #eaecf0;
  display: flex; align-items: center; gap: 10px;
  flex-shrink: 0;
}

.sidebar-footer-info { overflow: hidden; flex: 1; }
.sidebar-footer-name { font-size: 12px; font-weight: 700; color: var(--navy); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-footer-role { font-size: 11px; color: #9ca3af; }

/* ── MAIN CONTENT ── */
.main-content {
  margin-left: 270px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: #f0f2f5;
}

.topbar {
  background: #f8fafc; /* Matches sidebar header */
  border-bottom: 1px solid #e2e8f0;
  padding: 0 32px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 2px 10px rgba(0,0,0,0.02);
}

.topbar-title { font-size: 16px; font-weight: 700; color: var(--navy); font-family: 'Outfit', sans-serif; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }

.page-body { padding: 20px 24px; flex: 1; }

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

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }

.stat-icon {
  width: 46px; height: 46px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0;
}

.stat-icon.blue   { background: var(--info-bg);    }
.stat-icon.gold   { background: var(--warning-bg); }
.stat-icon.green  { background: var(--success-bg); }
.stat-icon.red    { background: var(--danger-bg);  }

.stat-val { font-size: 26px; font-weight: 800; color: var(--navy); line-height: 1; font-family: 'Outfit', sans-serif; }
.stat-lbl { font-size: 12px; color: var(--text-light); margin-top: 2px; }

/* ── PLAN BADGE ── */
.plan-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 12px; border-radius: 20px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase;
}

.plan-badge.basic    { background: #edf2f7; color: #4a5568; }
.plan-badge.pro      { background: var(--info-bg); color: var(--blue); }
.plan-badge.enterprise { background: linear-gradient(135deg,#fef3c7,#fde68a); color: #92400e; }

/* ── STATUS BADGE ── */
.status-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 600;
}

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

.status-badge.open       { background: var(--info-bg);    color: var(--info);    }
.status-badge.open::before    { background: var(--blue); }
.status-badge.in-progress { background: var(--warning-bg); color: var(--warning); }
.status-badge.in-progress::before { background: var(--warning); }
.status-badge.resolved   { background: var(--success-bg); color: var(--success); }
.status-badge.resolved::before   { background: var(--success); }
.status-badge.closed     { background: #edf2f7; color: #718096; }
.status-badge.closed::before     { background: #a0aec0; }

/* ── PRIORITY ── */
.priority-badge {
  display: inline-block;
  padding: 2px 8px; border-radius: 4px;
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
}

.priority-badge.low      { background: #edf2f7; color: #718096; }
.priority-badge.medium   { background: var(--info-bg); color: var(--blue); }
.priority-badge.high     { background: var(--warning-bg); color: var(--warning); }
.priority-badge.critical { background: var(--danger-bg); color: var(--danger); }

/* ── CARD / PANEL ── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.card-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-title { font-size: 15px; font-weight: 700; color: var(--navy); font-family: 'Outfit', sans-serif; }
.card-body  { padding: 20px 24px; }

/* ── TABLE ── */
.tbl-wrap { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; }
thead tr { border-bottom: 2px solid var(--border); }
th { padding: 10px 14px; text-align: left; font-size: 11px; font-weight: 600; color: var(--text-light); text-transform: uppercase; letter-spacing: 0.5px; white-space: nowrap; }
td { padding: 12px 14px; border-bottom: 1px solid var(--border); font-size: 13px; color: var(--text); vertical-align: middle; }
tbody tr:hover { background: #f7fafc; }
tbody tr:last-child td { border-bottom: none; }

.ticket-id { font-family: monospace; font-size: 12px; color: var(--text-light); }
.ticket-subject { font-weight: 600; color: var(--navy); max-width: 280px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ticket-subject small { display: block; font-weight: 400; color: var(--text-light); font-size: 11px; margin-top: 2px; }

/* ── BUTTONS ── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 18px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600; cursor: pointer;
  border: none; text-decoration: none; transition: var(--transition);
  font-family: 'Inter', sans-serif;
}

.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-light); transform: translateY(-1px); box-shadow: 0 4px 14px rgba(13,31,60,0.25); }

.btn-gold { background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 100%); color: var(--navy); }
.btn-gold:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(198,146,58,0.4); }

.btn-outline { background: transparent; color: var(--navy); border: 1.5px solid var(--border-dark); }
.btn-outline:hover { border-color: var(--navy); background: var(--bg); }

.btn-sm { padding: 5px 12px; font-size: 12px; border-radius: 6px; }

.btn-danger { background: var(--danger-bg); color: var(--danger); border: 1px solid #fed7d7; }
.btn-danger:hover { background: var(--danger); color: #fff; }

.btn-success { background: var(--success-bg); color: var(--success); border: 1px solid #c6f6d5; }
.btn-success:hover { background: var(--success); color: #fff; }

/* ── FORMS ── */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 12px; font-weight: 600; color: var(--text-mid); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.5px; }
.form-control {
  width: 100%; padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px; font-family: 'Inter', sans-serif;
  color: var(--navy); background: var(--white);
  transition: var(--transition);
  outline: none;
  appearance: none;
}
.form-control:focus { 
  border-color: var(--gold); 
  box-shadow: 0 0 0 4px rgba(184, 146, 58, 0.1); 
}
select.form-control { 
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%230d1f3c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 40px;
}
textarea.form-control { resize: vertical; min-height: 100px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* ── CUSTOM DROPDOWN ── */
.custom-dropdown {
  position: relative;
  width: 100%;
  min-width: 180px;
  margin-top: 4px;
  user-select: none;
}
.custom-dropdown-trigger {
  height: 36px;
  padding: 0 12px;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  font-size: 12px;
  color: var(--navy);
  transition: all 0.2s;
}
.custom-dropdown-trigger:hover { border-color: var(--gold); }
.custom-dropdown.active .custom-dropdown-trigger {
  border-color: var(--gold);
  box-shadow: 0 0 0 4px rgba(184, 146, 58, 0.1);
}
.custom-dropdown-options {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #eaecf0;
  border-radius: 10px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.1);
  z-index: 1000;
  max-height: 200px;
  overflow-y: auto;
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.custom-dropdown.active .custom-dropdown-options {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.custom-dropdown-option {
  padding: 10px 14px;
  font-size: 13px;
  color: var(--navy);
  cursor: pointer;
  transition: all 0.15s;
}
.custom-dropdown-option:hover {
  background: rgba(184, 146, 58, 0.08);
  color: var(--gold);
}
.custom-dropdown-option.selected {
  background: rgba(184, 146, 58, 0.12);
  color: var(--gold);
  font-weight: 600;
}

/* ── MODAL ── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(8,21,42,0.6);
  backdrop-filter: blur(4px);
  z-index: 500;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s;
}

.modal-overlay.open { opacity: 1; pointer-events: all; }

.modal {
  background: var(--white);
  border-radius: var(--radius);
  width: 100%; max-width: 560px;
  max-height: 90vh; overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  transform: translateY(20px);
  transition: transform 0.2s;
}

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

.modal-header {
  padding: 20px 24px 18px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}

.modal-title { font-size: 17px; font-weight: 700; color: var(--navy); font-family: 'Outfit', sans-serif; }
.modal-close { background: none; border: none; font-size: 20px; cursor: pointer; color: var(--text-light); line-height: 1; padding: 2px 6px; border-radius: 4px; transition: var(--transition); }
.modal-close:hover { background: var(--bg); color: var(--text); }
.modal-body   { padding: 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }

/* ── THREAD / COMMENTS ── */
.thread { 
  display: flex; 
  flex-direction: column; 
  gap: 20px; 
  background: #f9fafb; /* Light background like reference */
  padding: 24px;
  border-radius: 12px;
}

.thread-msg {
  display: flex; gap: 12px; align-items: flex-start;
}

.thread-msg.admin-msg { flex-direction: row-reverse; }

.thread-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; flex-shrink: 0;
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.thread-avatar.client { background: #e0f2fe; color: #0369a1; }
.thread-avatar.admin  { background: #fef3c7; color: #92400e; }

.thread-bubble {
  max-width: 85%;
  padding: 12px 16px;
  background: #ffffff !important;
  color: #111827 !important;
  border: 1px solid #e5e7eb;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  font-size: 14px;
  line-height: 1.5;
}

.thread-msg:not(.admin-msg) .thread-bubble { 
  border-radius: 0 12px 12px 12px; 
}
.thread-msg.msg-self { flex-direction: row-reverse; }
.thread-msg.msg-self .thread-bubble { border-radius: 12px 0 12px 12px; }
.thread-msg.msg-self .thread-meta { justify-content: flex-end; }
.thread-msg.msg-self .thread-status { text-align: right; }

.thread-msg.msg-other { flex-direction: row; }
.thread-msg.msg-other .thread-bubble { border-radius: 0 12px 12px 12px; }

.thread-meta { 
  font-size: 12px; 
  font-weight: 500;
  color: #6b7280; 
  margin-top: 4px; 
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ── MESSAGE OPTIONS ── */
.msg-container { position: relative; display: flex; flex-direction: column; }
.msg-actions-trigger {
  opacity: 0;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  cursor: pointer;
  color: #94a3b8;
  transition: all 0.2s;
  background: #fff;
  border: 1px solid #e2e8f0;
}
.thread-msg:hover .msg-actions-trigger { opacity: 1; }
.msg-actions-trigger:hover { background: #f8fafc; color: var(--navy); }

.msg-menu {
  position: absolute;
  top: 100%;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  padding: 4px;
  z-index: 100;
  display: none;
  min-width: 120px;
  margin-top: 4px;
}
/* Grow right for self (dots on left), Grow left for other (dots on right) */
.msg-self .msg-menu { left: 0; right: auto; }
.msg-other .msg-menu { right: 0; left: auto; }

.msg-menu.open { display: block; animation: scaleIn 0.1s ease-out; }

@keyframes scaleIn {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.msg-menu-item {
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 500;
  color: #475569;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.1s;
}
.msg-menu-item:hover { background: #f1f5f9; color: #1e293b; }
.msg-menu-item.danger { color: #dc2626; }
.msg-menu-item.danger:hover { background: #fef2f2; }

/* ── CHAT INPUT ── */
.chat-input-wrapper {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 8px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.chat-input-wrapper:focus-within {
  border-color: #c6923a;
  box-shadow: 0 0 0 3px rgba(198, 146, 58, 0.1);
}
.chat-input-wrapper textarea {
  width: 100%;
  border: none;
  background: none;
  padding: 8px;
  font-size: 14px;
  color: #1e293b;
  resize: none;
  min-height: 40px;
  outline: none;
  font-family: inherit;
}
.chat-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 8px;
  border-top: 1px solid #f1f5f9;
  margin-top: 4px;
}
.chat-action-btn {
  background: none;
  border: none;
  color: #64748b;
  padding: 6px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: all 0.2s;
}
.chat-action-btn:hover {
  background: #f1f5f9;
  color: #c6923a;
}
.btn-send {
  background: var(--navy);
  color: #fff;
  border: none;
  padding: 6px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
}
.btn-send:hover {
  background: #1a2a44;
  transform: translateY(-1px);
}
.btn-send svg { transition: transform 0.2s; }
.btn-send:hover svg { transform: translateX(2px) translateY(-1px); }

/* ── REPLY PREVIEW ── */
.reply-preview {
  display: none;
  background: #f8fafc;
  border-left: 4px solid #c6923a;
  padding: 8px 12px;
  margin-bottom: 8px;
  border-radius: 4px;
  position: relative;
  animation: slideUp 0.2s ease-out;
}
.reply-preview.active { display: block; }
.reply-preview-content {
  font-size: 13px;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 80%;
}
.reply-preview-name {
  font-weight: 700;
  font-size: 12px;
  color: #1e293b;
  margin-bottom: 2px;
}
.close-reply {
  position: absolute;
  right: 8px; top: 8px;
  cursor: pointer;
  color: #94a3b8;
  transition: color 0.2s;
}
.close-reply:hover { color: #ef4444; }

.reply-quote {
  font-size: 12px;
  background: rgba(0,0,0,0.05);
  padding: 4px 8px;
  border-left: 2px solid #c6923a;
  border-radius: 4px;
  margin-bottom: 4px;
  color: #64748b;
}

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

/* ── SUBSCRIPTION PLANS ── */
.plans-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.plan-card {
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  background: var(--bg-card);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.plan-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }

.plan-card.popular {
  border-color: var(--blue);
  box-shadow: 0 0 0 1px var(--blue), var(--shadow-lg);
}

.plan-card.enterprise-plan {
  border-color: var(--gold);
  background: linear-gradient(135deg, #fffbf2 0%, var(--white) 100%);
}

.plan-popular-tag {
  position: absolute; top: 16px; right: -28px;
  background: var(--blue); color: #fff;
  font-size: 10px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
  padding: 4px 40px;
  transform: rotate(45deg);
}

.plan-name    { font-size: 13px; font-weight: 700; color: var(--text-light); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px; }
.plan-price   { font-size: 36px; font-weight: 800; color: var(--navy); font-family: 'Outfit', sans-serif; line-height: 1; }
.plan-price span { font-size: 14px; font-weight: 400; color: var(--text-light); }
.plan-desc    { font-size: 12px; color: var(--text-light); margin: 8px 0 20px; }
.plan-features { list-style: none; margin-bottom: 24px; display: flex; flex-direction: column; gap: 8px; }
.plan-features li { font-size: 12px; color: var(--text-mid); display: flex; align-items: flex-start; gap: 8px; }
.plan-features li::before { content: '✓'; color: var(--success); font-weight: 700; flex-shrink: 0; margin-top: 1px; }
.plan-features li.no::before { content: '✕'; color: var(--text-light); }

/* ── ALERTS / TOASTS ── */
.toast-container { position: fixed; top: 20px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }

.toast {
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px 16px;
  display: flex; align-items: center; gap: 10px;
  box-shadow: var(--shadow-lg); font-size: 13px;
  min-width: 280px; max-width: 340px;
  animation: toastIn 0.3s ease;
  pointer-events: all;
}

.toast.success { border-left: 3px solid var(--success); }
.toast.error   { border-left: 3px solid var(--danger);  }
.toast.info    { border-left: 3px solid var(--blue);    }

@keyframes toastIn { from { opacity:0; transform: translateX(20px); } to { opacity:1; transform: translateX(0); } }
@keyframes toastOut { to { opacity:0; transform: translateX(20px); } }

/* ══════════════════════════════════════════════
   AUTH SCREEN — Full-bleed bg + glassmorphism card
   ══════════════════════════════════════════════ */

/* ── AUTH PAGE TOP NAVBAR (fixed, full-width) ── */
.auth-screen {
  min-height: 100vh;
  padding-top: 40px; /* Reduced since navbar is gone */
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding-left: 40px;
  padding-right: 40px;
  padding-bottom: 40px;
  gap: 80px;
}

/* Full bleed animated dark navy background with orbs */
.auth-home-btn {
  position: absolute;
  top: 30px;
  left: 30px;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  padding: 10px 18px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50px;
  transition: all 0.3s ease;
}

.auth-home-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

.auth-home-btn svg {
  color: #fff;
  transition: transform 0.3s ease;
}

.auth-home-btn:hover svg {
  transform: scale(1.1);
}

.auth-home-btn span {
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.5px;
  font-family: 'Outfit', sans-serif;
}

.auth-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(rgba(13, 31, 60, 0.4), rgba(13, 31, 60, 0.7)), url('images/login-bg.png');
  background-size: cover;
  background-position: center;
  z-index: 0;
}



/* Brand overlay — left column in flex layout */
.auth-overlay-brand {
  position: relative;
  z-index: 1;
  max-width: 560px;
  flex: 1;
  min-width: 0;
}

/* ── Auth page navbar (replaces brand pill) ── */
.auth-nav-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}

.auth-nav-logo img {
  height: 52px;
  width: auto;
  object-fit: contain;
  margin-right: -10px;
  /* logo has white bg — invert to blend on dark */
  filter: brightness(0) invert(1);
}

.auth-nav-logo-text {
  font-family: 'Outfit', sans-serif;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 1px;
}


.auth-hero-title {
  font-family: 'Outfit', sans-serif;
  font-size: 68px;
  font-weight: 900;
  color: #fff;
  line-height: 0.95;
  letter-spacing: -2px;
  text-transform: uppercase;
  margin-bottom: 18px;
  text-shadow: 0 4px 30px rgba(0,0,0,0.4);
}

.auth-hero-sub {
  font-family: 'Outfit', sans-serif;
  font-size: 16px;
  font-weight: 500;
  color: rgba(255,255,255,0.85);
  margin-bottom: 12px;
  text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.auth-hero-body {
  font-size: 13px;
  color: rgba(255,255,255,0.7);
  line-height: 1.75;
  text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

/* ── Glassmorphism card ── */
.auth-glass-card {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 400px;
  flex-shrink: 0;
  background: rgba(255,255,255,0.12);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 20px;
  padding: 36px 32px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.2);
}

/* Override form-label to be light for dark bg */
.auth-glass-card .form-label {
  display: block;
  color: rgba(255,255,255,0.85);
  font-size: 12px; font-weight: 600;
  text-transform: none; letter-spacing: 0;
  margin-bottom: 6px;
}

.auth-forgot {
  color: rgba(255,255,255,0.55);
  font-size: 11px; text-decoration: none;
  transition: color 0.2s;
}
.auth-forgot:hover { color: #e8b45a; }

/* Auth inputs — semi-transparent white */
.auth-input {
  background: rgba(255,255,255,0.92) !important;
  border: 1px solid rgba(255,255,255,0.3) !important;
  color: #1a202c !important;
  border-radius: 10px !important;
  font-size: 14px !important;
  padding: 11px 14px !important;
}
.auth-input::placeholder { color: #9ca3af; }
.auth-input:focus {
  border-color: var(--gold) !important;
  box-shadow: 0 0 0 3px rgba(198,146,58,0.25) !important;
  outline: none;
}

/* Auth tabs on card */
.auth-glass-card .auth-tabs {
  display: flex; gap: 0;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 10px;
  padding: 3px; margin-bottom: 22px;
}

.auth-glass-card .auth-tab {
  flex: 1; padding: 8px; text-align: center;
  font-size: 12px; font-weight: 600; cursor: pointer;
  border-radius: 8px; transition: all 0.2s;
  color: rgba(255,255,255,0.6);
}
.auth-glass-card .auth-tab.active {
  background: rgba(255,255,255,0.95);
  color: var(--navy);
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* Primary auth action button */
.btn-auth-primary {
  width: 100%; padding: 13px;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #fff;
  border: none; border-radius: 10px;
  font-size: 13px; font-weight: 700;
  letter-spacing: 1.5px; text-transform: uppercase;
  cursor: pointer; transition: all 0.2s;
  box-shadow: 0 4px 16px rgba(37,99,235,0.4);
  margin-bottom: 16px;
}
.btn-auth-primary:hover {
  background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(37,99,235,0.5);
}

/* Divider */
.auth-divider {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 14px;
  color: rgba(255,255,255,0.4); font-size: 11px;
}
.auth-divider::before, .auth-divider::after {
  content: ''; flex: 1;
  height: 1px; background: rgba(255,255,255,0.15);
}

/* Google button */
.btn-google {
  width: 100%; padding: 11px 16px;
  background: rgba(255,255,255,0.95);
  color: #374151;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 10px;
  font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all 0.2s;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  margin-bottom: 18px;
  font-family: 'Inter', sans-serif;
}
.btn-google:hover {
  background: #fff;
  box-shadow: 0 4px 14px rgba(0,0,0,0.15);
  transform: translateY(-1px);
}

/* Switch link */
.auth-switch-link {
  text-align: center; font-size: 12px;
  color: rgba(255,255,255,0.55);
}
.auth-switch-link a {
  color: #93c5fd; font-weight: 600; text-decoration: none;
}
.auth-switch-link a:hover { color: #e8b45a; }

/* ══════════════════════════════════════════════
   SIDEBAR — Connectify dark single-panel style
   ══════════════════════════════════════════════ */

.sidebar {
  width: 270px;
  flex-shrink: 0;
  background: linear-gradient(165deg, #1a2a44 0%, #0d1f3c 50%, #08152a 100%);
  position: relative;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  overflow-y: auto;
  border-right: 1px solid rgba(255,255,255,0.05);
  box-shadow: 10px 0 30px rgba(0,0,0,0.2);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
  opacity: 0.03;
  pointer-events: none;
  z-index: 0;
}

.sidebar.collapsed { width: 80px; }
.main-content.sidebar-collapsed { margin-left: 80px !important; }

/* Collapsed Header */
.sidebar.collapsed .sb-header { padding: 8px; margin: 8px; border-radius: 12px; height: 50px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.sidebar.collapsed .sb-logo { padding: 0; gap: 0; width: 100%; justify-content: center; }
.sidebar.collapsed .sb-logo-name { display: none !important; }
.sidebar.collapsed .sb-logo img { height: 28px; width: auto; margin-right: 0; min-width: 0; flex-shrink: 0; }

/* Collapsed Nav */
.sidebar.collapsed .sb-nav a { justify-content: center; padding: 12px 0; margin: 4px 8px; }
.sidebar.collapsed .sb-nav a span { display: none !important; }
.sidebar.collapsed .sb-nav-icon { margin: 0; width: 17px; height: 17px; }
.sidebar.collapsed .sb-nav a.active { box-shadow: inset 3px 0 0 var(--gold); border-radius: 8px; }

/* Collapsed Footer */
.sidebar.collapsed .sb-user-info, 
.sidebar.collapsed .sb-chevron { display: none; }
.sidebar.collapsed .sb-user-card { justify-content: center; padding: 10px; }
.sidebar.collapsed .sb-logout-btn { padding: 10px; justify-content: center; }
.sidebar.collapsed .sb-logout-btn svg { margin: 0; }
.sidebar.collapsed .sb-logout-btn-text { display: none; }


/* Top logo + CTA */
.sb-header {
  margin: 8px;
  padding: 6px 4px;
  background: #ffffff; 
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.05);
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.sb-logo {
  display: flex; 
  align-items: center; 
  gap: 0;
  white-space: nowrap;
}

.sb-logo img {
  height: 52px;
  width: auto;
  object-fit: contain;
  mix-blend-mode: multiply;
  margin-right: -2px; /* Matched to home page (-2px) */
}

.sb-logo-name {
  font-family: 'Outfit', sans-serif;
  font-size: 16px; font-weight: 800;
  line-height: 1;
  letter-spacing: 0.2px;
  white-space: nowrap;
}
.sb-logo-name .sb-blue { color: #0d1f3c; } /* Dark navy for UBIT on light bg */
.sb-logo-name .sb-gold { color: #c6923a; } /* Gold for TECHNOLOGIEZ */

/* Existing aliases - keeping for other uses if any */
.sb-blue-alt { color: #90cdf4; }
.sb-gold-alt { color: #e8b45a; }

.sb-new-btn {
  width: 100%;
  padding: 9px 14px;
  background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
  color: #fff;
  border: none; border-radius: 100px;
  font-size: 12px; font-weight: 700;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 7px;
  transition: all 0.2s;
  font-family: 'Inter', sans-serif;
  box-shadow: 0 4px 12px rgba(124,58,237,0.35);
}
.sb-new-btn:hover {
  background: linear-gradient(135deg, #6d28d9 0%, #5b21b6 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(124,58,237,0.45);
}

/* Teams/Plans section */
.sb-section {
  padding: 14px 16px 10px;
}

.sb-section-hdr {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 10px; font-weight: 700;
  color: rgba(255,255,255,0.35);
  letter-spacing: 1px; text-transform: uppercase;
  margin-bottom: 10px;
}
.sb-section-hdr a {
  color: rgba(255,255,255,0.4); text-decoration: none;
  font-size: 16px; line-height: 1;
  transition: color 0.2s;
}
.sb-section-hdr a:hover { color: #e8b45a; }

.sb-team-item {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 8px; border-radius: 8px;
  font-size: 13px; font-weight: 600; color: rgba(255,255,255,0.82);
  cursor: default; transition: background 0.15s;
  margin-bottom: 2px;
}
.sb-team-item:hover { background: rgba(255,255,255,0.06); }

.sb-team-dot {
  width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0;
}

.sb-divider { display: none; } /* Hidden as header has distinct bg now */

/* Nav */
.sb-nav {
  padding: 6px 10px; flex: 1;
}

.sb-nav a {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; border-radius: 10px;
  color: rgba(255,255,255,0.6); text-decoration: none;
  font-size: 13px; font-weight: 500;
  transition: all 0.15s; margin-bottom: 2px;
}

.sb-nav a:hover { background: rgba(255,255,255,0.07); color: rgba(255,255,255,0.9); }
.sb-nav a.active { 
  background: linear-gradient(90deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.03) 100%);
  color: #fff; 
  box-shadow: inset 2px 0 0 var(--gold); /* Left accent line */
  border-radius: 0 12px 12px 0;
  margin-right: 12px;
}

.sb-nav-icon {
  width: 17px; height: 17px; flex-shrink: 0;
  opacity: 0.7;
}
.sb-nav a.active .sb-nav-icon { opacity: 1; }

.sb-badge {
  margin-left: auto;
  background: #ff4d4d; color: #fff;
  font-size: 10px; font-weight: 700;
  padding: 1px 7px; border-radius: 20px;
  box-shadow: 0 0 10px rgba(255, 77, 77, 0.4);
}

/* Footer */
.sb-footer {
  padding: 16px;
  border-top: 1px solid rgba(255,255,255,0.06);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sb-user-card {
  display: flex; align-items: center; gap: 12px;
  padding: 8px; border-radius: 12px;
  background: rgba(255,255,255,0.03);
  cursor: pointer; transition: all 0.2s;
}
.sb-user-card:hover { background: rgba(255,255,255,0.06); }

.sb-avatar {
  width: 32px; height: 32px; border-radius: 10px;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 100%);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: var(--navy); flex-shrink: 0;
}

.sb-user-info { flex: 1; overflow: hidden; }
.sb-user-name { font-size: 13px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-user-role { font-size: 11px; color: #94a3b8; }

.sb-chevron { width: 16px; height: 16px; color: rgba(255,255,255,0.35); flex-shrink: 0; }

.sb-logout-btn {
  width: 100%; padding: 10px 14px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  color: #ffffff; /* Explicit white for visibility */
  border-radius: 12px;
  font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all 0.2s;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font-family: 'Inter', sans-serif;
}
.sb-logout-btn:hover {
  background: rgba(220,38,38,0.15);
  border-color: rgba(220,38,38,0.3);
  color: #f87171;
}

.sb-collapse-btn {
  width: 100%; padding: 10px;
  background: rgba(0,0,0,0.2);
  border: 1px solid rgba(255,255,255,0.1);
  color: #fff;
  border-radius: 10px;
  cursor: pointer; transition: all 0.2s;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 12px; font-weight: 600;
  margin-top: 8px;
}

.sb-collapse-btn:hover { background: rgba(255,255,255,0.1); transform: translateY(-1px); }

.sidebar.collapsed .sb-collapse-btn svg { transform: rotate(180deg); }
.sidebar.collapsed .sb-collapse-btn span { display: none !important; }
.sidebar.collapsed .sb-logout-btn span { display: none !important; }
.sidebar.collapsed .sb-nav a span { display: none !important; }


/* Keep old aliases for compatibility */
.sidebar-avatar { display: none; }
.sidebar-user-name, .sidebar-user-plan { display: none; }

/* ── MISC ── */
.empty-state { text-align: center; padding: 48px 24px; color: var(--text-light); }
.empty-state .empty-icon { font-size: 40px; margin-bottom: 12px; }
.empty-state h3 { font-size: 16px; font-weight: 600; color: var(--text-mid); margin-bottom: 6px; }
.empty-state p  { font-size: 13px; }

.section-header { margin-bottom: 24px; }
.section-header h2 { font-family: 'Outfit', sans-serif; font-size: 22px; font-weight: 800; color: var(--navy); }
.section-header p  { font-size: 13px; color: var(--text-light); margin-top: 4px; }

.divider { height: 1px; background: var(--border); margin: 20px 0; }

.text-right { text-align: right; }
.text-center { text-align: center; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-4 { margin-bottom: 16px; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }

/* ── TABS ── */
.tab-bar { display: flex; gap: 4px; border-bottom: 2px solid var(--border); margin-bottom: 20px; }
.tab-btn { padding: 10px 16px; font-size: 13px; font-weight: 600; color: var(--text-light); background: none; border: none; cursor: pointer; position: relative; transition: var(--transition); }
.tab-btn.active { color: var(--navy); }
.tab-btn.active::after { content: ''; position: absolute; bottom: -2px; left: 0; right: 0; height: 2px; background: var(--navy); border-radius: 2px 2px 0 0; }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ── SEARCH / FILTER BAR ── */
.filter-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.filter-bar .form-control { width: auto; }
.search-input { flex: 1; min-width: 200px; }

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .sidebar { width: 0; overflow: hidden; transform: translateX(-100%); transition: transform 0.3s; }
  .sidebar.open { width: 240px; transform: translateX(0); }
  .main-content { margin-left: 0; }
  .auth-overlay-brand { display: none; }
  .auth-screen { justify-content: center; padding: 20px; padding-top: 80px; gap: 0; }
  .auth-nav-links { display: none; }
  .auth-page-navbar-inner { padding: 0 20px; }
  .form-row { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .page-body { padding: 16px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .topbar { padding: 0 16px; }
}

/* ── ATTACHMENT UI ── */
.attach-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-mid);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition);
}
.attach-btn:hover {
  background: var(--border);
  color: var(--navy);
}
.thread-bubble img {
  max-width: 260px;
  max-height: 200px;
  border-radius: 6px;
  margin-top: 8px;
  display: block;
  cursor: pointer;
  transition: opacity 0.2s;
}
.thread-bubble img:hover { opacity: 0.88; }

/* Modal footer split layout */
.modal-footer { justify-content: space-between; }
.modal-footer-left  { display: flex; gap: 8px; align-items: center; }
.modal-footer-right { display: flex; gap: 8px; }

/* Attachment preview container */
.attach-preview {
  display: inline-block;
  position: relative;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.attach-preview img {
  max-height: 120px;
  max-width: 280px;
  display: block;
}
.attach-preview-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  background: rgba(0,0,0,0.6);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  cursor: pointer;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* ── LIVE PULSE INDICATOR ── */
@keyframes livePulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.4; transform: scale(0.75); }
}

/* ── RESPONSIVE STATES ── */
.sidebar.mobile-active { transform: translateX(0) !important; }

.sidebar-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(13, 31, 60, 0.25); /* Lighter brand-aware dim */
  z-index: 95;
  display: none;
  /* Blur removed as per user request to avoid visual confusion */
}

.sidebar-overlay.active { display: block; }

.menu-toggle {
  display: flex; /* Always visible for collapse/mobile toggle */
  background: none; border: none;
  color: #0d1f3c;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  align-items: center; justify-content: center;
  transition: all 0.2s;
}

.menu-toggle:hover { background: rgba(0,0,0,0.05); transform: scale(1.05); }


@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
    box-shadow: 10px 0 30px rgba(0,0,0,0.2);
    width: 280px;
    z-index: 1000;
  }
  
  .sidebar.mobile-active { transform: translateX(0) !important; }

  .main-content { 
    margin-left: 0 !important; 
    width: 100% !important; 
    transition: filter 0.3s ease;
  }
  
  /* Remove blur on main content when sidebar is active if any */
  .main-content.sidebar-active { filter: none !important; }

  .page-body { padding: 12px; }
  .topbar { padding: 0 12px; height: 56px; }
  .topbar-title { font-size: 15px; }
  
  .sb-header { margin: 8px; padding: 12px 8px; }
  
  /* Mobile Table Fix */
  .tbl-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 8px;
    background: #fff;
    border: 1px solid var(--border);
  }
  
  table { min-width: 700px; }
  th, td { padding: 12px 10px; font-size: 12px; }
}

@media (max-width: 640px) {
  .topbar-datetime { display: none; }
  .topbar-actions { gap: 6px; }
  
  .stats-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  
  .stat-card { padding: 14px; }
  .stat-val { font-size: 22px; }
  
  .filter-bar {
    flex-direction: column;
    gap: 8px;
    padding: 10px;
  }
  
  .filter-bar .form-control {
    width: 100% !important;
    font-size: 12px;
  }

  /* Stacked form rows on mobile */
  .form-row {
    flex-direction: column;
    gap: 0;
  }
  
  .card-header { padding: 12px; }
  .card-title { font-size: 13px; }
  
  /* Ticket modal adjustments */
  .modal {
    width: 95%;
    margin: 10px;
    max-height: 90vh;
  }
}
