/* ================================================================
   Bulldog Champions – Brand Ambassador Platform
   Main Stylesheet
   ================================================================ */

/* ── Reset & Base ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --gold:         #c9a227;
  --gold-light:   #e4bc45;
  --gold-dark:    #9e7d1a;
  --gold-dim:     rgba(201,162,39,.15);
  --bg-app:       #1a1714;
  --bg-card:      #252118;
  --bg-card2:     #2e2a22;
  --bg-sidebar:   #0f0e0b;
  --bg-input:     #2a261e;
  --border:       rgba(201,162,39,.2);
  --text:         #f0ead8;
  --text-muted:   #9e9580;
  --text-dark:    #6b6355;
  --success:      #4caf7d;
  --error:        #e05252;
  --warning:      #f0a430;
  --info:         #5b9bd5;
  --radius:       10px;
  --radius-lg:    16px;
  --sidebar-w:    240px;
  --sidebar-w-sm: 66px;
  --shadow:       0 4px 24px rgba(0,0,0,.4);
  --transition:   .22s ease;
}

html { font-size: 15px; scroll-behavior: smooth; }
body {
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  background: var(--bg-app);
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-light); }

img { max-width: 100%; display: block; }

input, select, textarea, button {
  font-family: inherit;
  font-size: inherit;
}

/* ── Layout ────────────────────────────────────────────────────── */
.app-wrapper {
  display: flex;
  min-height: 100vh;
}

.main-content {
  flex: 1;
  margin-left: var(--sidebar-w);
  transition: margin-left var(--transition);
  min-width: 0;
}

.main-content.collapsed { margin-left: var(--sidebar-w-sm); }

/* ── Sidebar ───────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 200;
  transition: width var(--transition), transform var(--transition);
  overflow: hidden;
}

.sidebar.collapsed { width: var(--sidebar-w-sm); }

/* ── Mobile sidebar overlay backdrop ──────────────────────────── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  z-index: 199;
}
.sidebar-overlay.active { display: block; }

/* ── Topbar hamburger (mobile only) ───────────────────────────── */
.topbar-hamburger {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.15rem;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 6px;
  margin-right: 4px;
  line-height: 1;
  transition: background var(--transition), color var(--transition);
}
.topbar-hamburger:hover { background: var(--gold-dim); color: var(--gold); }

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 14px 14px;
  border-bottom: 1px solid var(--border);
  min-height: 76px;
  flex-shrink: 0;
}

.sidebar-logo {
  width: 120px;
  transition: opacity var(--transition), width var(--transition);
  object-fit: contain;
}

.sidebar.collapsed .sidebar-logo { width: 0; opacity: 0; }

.collapse-btn {
  background: none;
  border: none;
  color: var(--gold);
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  font-size: 1.1rem;
  transition: background var(--transition);
  flex-shrink: 0;
}
.collapse-btn:hover { background: var(--gold-dim); }

.sidebar-nav {
  list-style: none;
  padding: 10px 0;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.nav-item { position: relative; }

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  color: var(--text-muted);
  border-radius: var(--radius);
  margin: 2px 8px;
  transition: background var(--transition), color var(--transition);
  white-space: nowrap;
  overflow: hidden;
}

.nav-link:hover,
.nav-item.active .nav-link {
  background: var(--gold-dim);
  color: var(--gold-light);
}

.nav-item.active .nav-link { border-left: 3px solid var(--gold); padding-left: 13px; }

.nav-icon {
  font-size: 1.05rem;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.nav-label {
  font-size: .88rem;
  font-weight: 500;
  transition: opacity var(--transition), width var(--transition);
}

.sidebar.collapsed .nav-label { opacity: 0; width: 0; overflow: hidden; }

.nav-link-danger { color: #e05252 !important; }
.nav-link-danger:hover { background: rgba(224,82,82,.12) !important; color: #ff7070 !important; }

.sidebar-footer {
  border-top: 1px solid var(--border);
  padding-bottom: 6px;
}

/* Tooltip when collapsed */
.sidebar.collapsed .nav-item:hover::after {
  content: attr(data-label);
  position: absolute;
  left: calc(var(--sidebar-w-sm) + 8px);
  top: 50%;
  transform: translateY(-50%);
  background: var(--bg-card2);
  color: var(--text);
  padding: 5px 10px;
  border-radius: 6px;
  font-size: .82rem;
  white-space: nowrap;
  border: 1px solid var(--border);
  pointer-events: none;
  z-index: 200;
}

/* ── Top Bar ───────────────────────────────────────────────────── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  height: 62px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
  gap: 16px;
}

.topbar-left h1 {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: .03em;
}
.topbar-left p { font-size: .8rem; color: var(--text-muted); }

.topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.topbar-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--gold-dark);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .9rem;
  cursor: pointer;
  border: 2px solid var(--gold);
  overflow: hidden;
}

.topbar-avatar img { width: 100%; height: 100%; object-fit: cover; }

.topbar-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  background: var(--gold);
  color: #1a1714;
  border: none;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: .82rem;
  cursor: pointer;
  transition: background var(--transition);
  text-decoration: none;
}
.topbar-btn:hover { background: var(--gold-light); color: #1a1714; }

/* ── Page Body ─────────────────────────────────────────────────── */
.page-body { padding: 28px; }

/* ── Cards ─────────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
}

.card-title {
  font-size: .95rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-title i { color: var(--gold); }

/* ── Progress Bar ──────────────────────────────────────────────── */
.progress-bar {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--gold-dark), var(--gold-light));
  transition: width .6s ease;
}

/* ── Grid Layouts ──────────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

/* ── Tables ────────────────────────────────────────────────────── */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: .88rem;
}

thead th {
  background: var(--bg-card2);
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  font-size: .75rem;
  letter-spacing: .06em;
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
tbody tr:hover { background: var(--gold-dim); }
tbody tr:last-child { border-bottom: none; }

td { padding: 12px 16px; color: var(--text); vertical-align: middle; }

/* ── Badges ────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: .75rem;
  font-weight: 600;
}
.badge-gold    { background: rgba(201,162,39,.18); color: var(--gold-light); }
.badge-success { background: rgba(76,175,125,.18); color: #6bcf9e; }
.badge-error   { background: rgba(224,82,82,.18);  color: #ff8080; }
.badge-warning { background: rgba(240,164,48,.18); color: #f5bf6a; }
.badge-muted   { background: rgba(255,255,255,.06); color: var(--text-muted); }

/* ── Buttons ───────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: .85rem;
  cursor: pointer;
  transition: all var(--transition);
  border: none;
  text-decoration: none;
}

.btn-primary   { background: var(--gold); color: #1a1714; }
.btn-primary:hover { background: var(--gold-light); color: #1a1714; }

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}
.btn-outline:hover { border-color: var(--gold); color: var(--gold); }

/* ── Forms ─────────────────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }

.form-label {
  font-size: .82rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
}

.form-control {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 10px 14px;
  transition: border-color var(--transition), box-shadow var(--transition);
  width: 100%;
}
.form-control:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-dim);
}
.form-control::placeholder { color: var(--text-dark); }

select.form-control { cursor: pointer; }
select.form-control option { background: var(--bg-card2); }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-hint { font-size: .78rem; color: var(--text-muted); margin-top: 4px; }

/* Checkbox / Role toggles */
.role-grid { display: flex; flex-wrap: wrap; gap: 10px; }

.role-check {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
  user-select: none;
  font-size: .85rem;
}
.role-check:has(input:checked) {
  border-color: var(--gold);
  background: var(--gold-dim);
  color: var(--gold-light);
}
.role-check input { display: none; }

/* ── Alerts ────────────────────────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: .88rem;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.alert-success { background: rgba(76,175,125,.15); border: 1px solid rgba(76,175,125,.3); color: #6bcf9e; }
.alert-error   { background: rgba(224,82,82,.15);  border: 1px solid rgba(224,82,82,.3);  color: #ff8080; }
.alert-warning { background: rgba(240,164,48,.15); border: 1px solid rgba(240,164,48,.3); color: #f5bf6a; }
.alert-info    { background: rgba(91,155,213,.15); border: 1px solid rgba(91,155,213,.3); color: #7fb8e8; }

/* ── Modal ─────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.7);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}
.modal-overlay.open { opacity: 1; pointer-events: all; }

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(20px);
  transition: transform var(--transition);
}
.modal-overlay.open .modal { transform: translateY(0); }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}
.modal-title { font-size: 1.1rem; font-weight: 700; }
.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.2rem;
  padding: 4px;
  transition: color var(--transition);
}
.modal-close:hover { color: var(--text); }

/* ── Avatar initials ───────────────────────────────────────────── */
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-weight: 700;
  background: var(--gold-dark);
  color: #fff;
  flex-shrink: 0;
  overflow: hidden;
}
.avatar-lg { width: 72px; height: 72px; font-size: 1.4rem; }

/* ── Login Page ────────────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg-app);
  padding: 24px;
}

.login-logo { width: 190px; margin-bottom: 28px; }

.login-card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 36px 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow);
}

.login-card h2 { color: #1a1714; font-size: 1.5rem; font-weight: 700; text-align: center; margin-bottom: 6px; }
.login-card .subtitle {
  color: #888;
  font-size: .88rem;
  text-align: center;
  margin-bottom: 26px;
}
.login-card .subtitle a { color: var(--gold); }

.login-card .form-label { color: #555; }

.login-card .form-control {
  background: #f6f4f0;
  border-color: #ddd;
  color: #222;
}
.login-card .form-control:focus { border-color: var(--gold); }
.login-card .form-control::placeholder { color: #aaa; }

.login-btn {
  width: 100%;
  padding: 12px;
  background: var(--gold);
  color: #1a1714;
  border: none;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: .95rem;
  cursor: pointer;
  transition: background var(--transition);
  margin-top: 4px;
}
.login-btn:hover { background: var(--gold-light); }

.login-footer {
  margin-top: 22px;
  font-size: .85rem;
  color: var(--text-muted);
  text-align: center;
}
.login-footer a { color: var(--gold); font-weight: 600; }

/* ── Misc Utilities ────────────────────────────────────────────── */
.d-flex      { display: flex; }
.align-center{ align-items: center; }
.justify-between { justify-content: space-between; }
.gap-3  { gap: 12px; }
.mt-2   { margin-top: 12px; }
.mt-3   { margin-top: 18px; }
.text-gold   { color: var(--gold); }
.text-muted  { color: var(--text-muted); }
.text-sm     { font-size: .82rem; }
.font-bold   { font-weight: 700; }

/* ── Responsive ────────────────────────────────────────────────── */

@media (max-width: 900px) {
  .grid-2, .form-row { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  /* Sidebar: hidden off-screen, slides in as overlay */
  .sidebar {
    width: var(--sidebar-w) !important;
    transform: translateX(-100%);
  }
  .sidebar.mobile-open { transform: translateX(0); }

  /* Show nav labels and logo (override desktop icon-only state) */
  .sidebar .nav-label { opacity: 1 !important; width: auto !important; overflow: visible !important; }
  .sidebar .sidebar-logo { width: 120px !important; opacity: 1 !important; }

  /* Content takes full width — sidebar is an overlay, not pushing */
  .main-content { margin-left: 0 !important; }
  .main-content.collapsed { margin-left: 0 !important; }

  /* Change collapse-btn to close icon when sidebar is open */
  .sidebar.mobile-open .collapse-btn .fa-bars::before { content: '\f00d'; } /* fa-xmark */

  /* Topbar */
  .topbar { padding: 0 14px; }
  .topbar-hamburger { display: flex; align-items: center; }

  /* General */
  .page-body { padding: 16px; }
  .login-card { padding: 26px 20px; }
}

/* ================================================================
   PWA Install Prompt
   ================================================================ */

@keyframes pwa-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(201,162,39,.5); }
  60%       { box-shadow: 0 0 0 8px rgba(201,162,39,0); }
}

/* ── Bottom banner ───────────────────────────────────────────── */
#pwa-banner {
  position: fixed;
  bottom: -130px;
  left: 0; right: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  background: #1c1912;
  border-top: 3px solid var(--gold);
  box-shadow: 0 -8px 40px rgba(0,0,0,.7);
  transition: bottom .5s cubic-bezier(.34,1.2,.64,1);
}
#pwa-banner.visible { bottom: 0; }

.pwa-banner-icon {
  flex-shrink: 0;
  width: 54px; height: 54px;
  background: #fff;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 10px rgba(0,0,0,.4);
  overflow: hidden;
}
.pwa-banner-icon img { width: 46px; height: 46px; object-fit: contain; }

.pwa-banner-body {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; gap: 3px;
}
.pwa-banner-body strong {
  color: var(--text);
  font-size: .95rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pwa-banner-body span {
  color: var(--text-muted);
  font-size: .78rem;
}

.pwa-btn-install {
  flex-shrink: 0;
  background: var(--gold);
  color: #000;
  border: none;
  border-radius: 8px;
  padding: 11px 22px;
  font-weight: 700;
  font-size: .88rem;
  cursor: pointer;
  white-space: nowrap;
  display: flex; align-items: center; gap: 6px;
  transition: background .2s, transform .1s;
  animation: pwa-pulse 2s ease-out 1s infinite;
}
.pwa-btn-install:hover  { background: var(--gold-light); animation: none; }
.pwa-btn-install:active { transform: scale(.97); }

.pwa-btn-dismiss {
  flex-shrink: 0;
  background: none; border: none;
  color: var(--text-muted); cursor: pointer;
  font-size: 1.1rem; padding: 6px 8px;
  line-height: 1;
  transition: color .2s;
}
.pwa-btn-dismiss:hover { color: var(--text); }

/* ── Install modal ───────────────────────────────────────────── */
.pwa-modal-box { text-align: center; max-width: 380px; }

.pwa-modal-logo {
  width: 80px; height: 80px;
  object-fit: contain;
  border-radius: 20px;
  margin-bottom: 16px;
  background: #fff;
  padding: 10px;
  box-shadow: 0 4px 20px rgba(0,0,0,.4);
}
.pwa-modal-box h3 { color: var(--gold); margin: 0 0 10px; font-size: 1.2rem; font-weight: 700; }
.pwa-modal-box p  { color: var(--text-muted); font-size: .88rem; margin: 0 0 20px; line-height: 1.6; }

.pwa-instructions { text-align: left !important; line-height: 1.7 !important; }

.pwa-modal-features {
  display: flex; gap: 8px; justify-content: center;
  margin-bottom: 24px; flex-wrap: wrap;
}
.pwa-feature {
  background: var(--gold-dim);
  color: var(--gold-light);
  border-radius: 8px;
  padding: 7px 13px;
  font-size: .79rem;
  font-weight: 600;
  display: flex; align-items: center; gap: 6px;
}

.pwa-modal-install {
  width: 100%; margin-bottom: 12px;
  padding: 13px; font-size: .97rem; font-weight: 700;
}
.pwa-modal-skip {
  background: none; border: none;
  color: var(--text-muted); cursor: pointer;
  font-size: .84rem; text-decoration: underline; width: 100%;
  transition: color .2s;
}
.pwa-modal-skip:hover { color: var(--text); }

/* ── Sidebar install button ──────────────────────────────────── */
.nav-link-install { color: var(--gold) !important; }
.nav-link-install:hover { background: var(--gold-dim) !important; }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 520px) {
  #pwa-banner { padding: 14px 14px; gap: 10px; }
  .pwa-banner-icon { width: 46px; height: 46px; }
  .pwa-banner-icon img { width: 38px; height: 38px; }
  .pwa-banner-body strong { font-size: .87rem; }
  .pwa-btn-install { padding: 10px 16px; font-size: .82rem; }
}

/* ================================================================
   Communications / Support Ticket System
   ================================================================ */

.comm-container {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 134px);
  margin-top: 16px;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
}

/* ── Tabs ────────────────────────────────────────────────────── */
.comm-tabs { display: flex; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.comm-tab {
  flex: 1; padding: 15px 20px; text-align: center; cursor: pointer;
  color: var(--text-muted); font-size: .85rem; font-weight: 500;
  border: none; background: none; border-bottom: 2px solid transparent;
  display: flex; align-items: center; justify-content: center; gap: 7px;
  transition: color var(--transition); margin-bottom: -1px;
}
.comm-tab:hover:not(.active) { color: var(--text); }
.comm-tab.active { color: var(--gold); border-bottom-color: var(--gold); }

.comm-tab-panel { flex: 1; min-height: 0; overflow: hidden; display: flex; flex-direction: column; }
.comm-body      { display: flex; flex-direction: row; }

.comm-placeholder {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; height: 100%; gap: 14px;
  color: var(--text-muted); padding: 40px;
}
.comm-placeholder i { font-size: 2.5rem; opacity: .25; }
.comm-placeholder p { font-size: .9rem; }

/* ── Left panel ──────────────────────────────────────────────── */
.comm-left {
  width: 300px; min-width: 260px; border-right: 1px solid var(--border);
  display: flex; flex-direction: column; overflow: hidden; flex-shrink: 0;
}
.comm-left-header {
  padding: 14px 16px; display: flex; align-items: center;
  justify-content: space-between; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.comm-left-title { font-size: .9rem; font-weight: 600; color: var(--text); }
.comm-new-btn {
  background: var(--gold-dim); color: var(--gold);
  border: 1px solid rgba(201,162,39,.3); border-radius: 6px;
  padding: 5px 12px; font-size: .78rem; font-weight: 600;
  cursor: pointer; display: flex; align-items: center; gap: 5px;
  transition: background var(--transition);
}
.comm-new-btn:hover { background: rgba(201,162,39,.25); }

.comm-list { overflow-y: auto; flex: 1; }

.comm-list-empty {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 40px 20px; gap: 10px;
  color: var(--text-muted); text-align: center;
}
.comm-list-empty i { font-size: 2rem; opacity: .25; }
.comm-list-empty p { font-size: .82rem; line-height: 1.5; }

/* ── Conversation items ──────────────────────────────────────── */
.comm-item {
  display: flex; align-items: flex-start; gap: 11px;
  padding: 13px 14px; cursor: pointer;
  border-bottom: 1px solid rgba(201,162,39,.07);
  transition: background var(--transition); position: relative;
}
.comm-item:hover  { background: rgba(201,162,39,.06); }
.comm-item.active { background: rgba(201,162,39,.13); }

.comm-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .78rem; font-weight: 700; color: #fff; flex-shrink: 0;
}
.comm-item-body  { flex: 1; min-width: 0; }
.comm-item-top   { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; margin-bottom: 2px; }
.comm-item-name  { font-size: .85rem; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.comm-item-time  { font-size: .7rem; color: var(--text-dark); flex-shrink: 0; }
.comm-item-sub   { font-size: .73rem; color: var(--gold); margin-bottom: 3px; }
.comm-item-preview { font-size: .78rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.comm-status-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; margin-top: 6px; }
.dot-green  { background: var(--success); }
.dot-yellow { background: var(--warning); }
.dot-blue   { background: var(--info); }
.dot-grey   { background: var(--text-muted); }
.dot-dark   { background: var(--text-dark); }

/* ── Right panel ─────────────────────────────────────────────── */
.comm-right { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 0; }
.comm-empty {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 12px; color: var(--text-muted);
}
.comm-empty i { font-size: 2.5rem; opacity: .2; }
.comm-empty p { font-size: .88rem; }

.comm-thread { flex-direction: column; flex: 1; overflow: hidden; }

.comm-thread-header {
  padding: 14px 22px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0; gap: 12px;
}
.comm-thread-info { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.comm-thread-name { font-size: .93rem; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.comm-thread-sub  { font-size: .76rem; color: var(--text-muted); margin-top: 2px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ── Status badges ───────────────────────────────────────────── */
.ticket-status {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 20px;
  font-size: .68rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em;
}
.status-open             { color: var(--success); background: rgba(76,175,125,.15); }
.status-in_progress      { color: var(--warning); background: rgba(240,164,48,.15); }
.status-waiting_response { color: var(--info);    background: rgba(91,155,213,.15); }
.status-resolved         { color: var(--text-muted); background: rgba(158,149,128,.12); }
.status-closed           { color: var(--text-dark);  background: rgba(107,99,85,.12); }

.status-update-form { flex-shrink: 0; }
.status-select {
  background: var(--bg-input); color: var(--text);
  border: 1px solid var(--border); border-radius: 6px;
  padding: 6px 10px; font-size: .8rem; cursor: pointer;
}
.status-select:focus { outline: none; border-color: var(--gold); }

/* ── Messages ────────────────────────────────────────────────── */
.comm-messages {
  flex: 1; overflow-y: auto; padding: 20px 22px;
  display: flex; flex-direction: column; gap: 18px;
}
.comm-message { display: flex; gap: 11px; align-items: flex-start; }
.comm-msg-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .72rem; font-weight: 700; color: #fff; flex-shrink: 0;
}
.comm-msg-content { flex: 1; min-width: 0; }
.comm-msg-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; }
.comm-msg-author { font-size: .8rem; font-weight: 600; color: var(--text); }
.comm-msg-time   { font-size: .72rem; color: var(--text-dark); }
.comm-staff-badge {
  font-size: .65rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--info);
  background: rgba(91,155,213,.15); border-radius: 4px; padding: 1px 6px;
}
.comm-msg-bubble { padding: 11px 15px; font-size: .85rem; line-height: 1.6; word-break: break-word; }
.user-bubble  { background: var(--bg-card2); color: var(--text); border-radius: 4px 12px 12px 12px; }
.staff-bubble {
  background: rgba(91,155,213,.1); border: 1px solid rgba(91,155,213,.18);
  border-radius: 12px 4px 12px 12px; color: var(--text);
}
.comm-resolved-notice {
  text-align: center; color: var(--text-muted); font-size: .8rem;
  padding: 12px; background: rgba(158,149,128,.07); border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center; gap: 7px;
}
.comm-resolved-notice i { color: var(--success); }

/* ── Reply form ──────────────────────────────────────────────── */
.comm-reply { padding: 14px 22px; border-top: 1px solid var(--border); flex-shrink: 0; }
.comm-reply-form { display: flex; flex-direction: column; gap: 10px; }
.comm-reply-textarea {
  width: 100%; background: var(--bg-input); border: 1px solid var(--border);
  color: var(--text); border-radius: var(--radius); padding: 11px 14px;
  font-family: inherit; font-size: .86rem; resize: none;
  transition: border-color var(--transition);
}
.comm-reply-textarea:focus { outline: none; border-color: var(--gold); }
.comm-reply-btn { align-self: flex-end; display: flex; align-items: center; gap: 7px; padding: 10px 22px; }

/* ── Profile dropdown ───────────────────────────────────────── */
.profile-dd-wrap { position: relative; }
.profile-dd-trigger {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--gold-dim); border: 2px solid var(--gold);
  color: var(--gold); font-size: .85rem; font-weight: 700;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  padding: 0; transition: box-shadow .15s;
}
.profile-dd-trigger:hover,
.profile-dd-trigger.active { box-shadow: 0 0 0 3px rgba(201,162,39,.25); }
.profile-dd-avatar-img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.profile-dd-initials { line-height: 1; }

.profile-dd-panel {
  position: absolute; top: calc(100% + 10px); right: 0;
  width: 230px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: 0 8px 32px rgba(0,0,0,.35);
  z-index: 1100; overflow: hidden;
}
.profile-dd-header {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
}
.profile-dd-header-avatar {
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
  background: var(--gold-dim); border: 2px solid var(--gold);
  color: var(--gold); font-size: .9rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.profile-dd-header-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-dd-name  { font-weight: 700; font-size: .85rem; color: var(--text); }
.profile-dd-email { font-size: .72rem; color: #9a9ab0; margin-top: 2px; word-break: break-all; }
.profile-dd-divider { height: 1px; background: var(--border); }
.profile-dd-item {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 16px; font-size: .83rem; color: var(--text);
  transition: background .12s; text-decoration: none;
}
.profile-dd-item i { width: 16px; text-align: center; color: #9a9ab0; font-size: .85rem; }
.profile-dd-item:hover { background: rgba(255,255,255,.05); }
.profile-dd-item-danger { color: #e05252; }
.profile-dd-item-danger i { color: #e05252; }
.profile-dd-item-danger:hover { background: rgba(224,82,82,.08); }

/* ── Floating ? button ───────────────────────────────────────── */
.support-fab {
  position: fixed; bottom: 24px; right: 24px;
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--gold); color: #1a1714; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.25rem; box-shadow: 0 4px 20px rgba(201,162,39,.45);
  z-index: 1000; transition: transform .2s, box-shadow .2s;
}
.support-fab:hover { transform: scale(1.1); box-shadow: 0 6px 28px rgba(201,162,39,.6); }

/* ── Support modal ───────────────────────────────────────────── */
.support-modal-box { width: 100%; max-width: 460px; padding: 0; overflow: hidden; }
.support-step        { display: none; padding: 24px 26px; }
.support-step.active { display: block; }

.support-modal-header { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; position: relative; }
.support-modal-header h3 { font-size: 1.05rem; font-weight: 700; color: var(--text); flex: 1; margin: 0; }
.support-modal-header p  { font-size: .83rem; color: var(--text-muted); flex: 1; margin: 0; }
#support-step-1 .support-modal-header { flex-direction: column; align-items: flex-start; }
#support-step-1 .support-modal-header .modal-close { position: absolute; top: 0; right: 0; }

.support-back-btn {
  background: none; border: none; color: var(--text-muted);
  cursor: pointer; font-size: 1rem; padding: 4px 8px;
  transition: color .2s; flex-shrink: 0;
}
.support-back-btn:hover { color: var(--text); }
.support-selected-cat { flex: 1; display: flex; align-items: center; gap: 10px; font-size: .9rem; font-weight: 600; color: var(--text); }

.support-categories { display: flex; flex-direction: column; gap: 8px; }
.support-category-row {
  display: flex; align-items: center; gap: 14px;
  padding: 13px 16px; background: var(--bg-card2);
  border: 1px solid var(--border); border-radius: var(--radius);
  cursor: pointer; text-align: left; width: 100%;
  transition: background var(--transition), border-color var(--transition);
}
.support-category-row:hover { background: var(--gold-dim); border-color: rgba(201,162,39,.4); }
.support-cat-icon {
  width: 36px; height: 36px; border-radius: 8px;
  background: var(--gold-dim); color: var(--gold);
  display: flex; align-items: center; justify-content: center;
  font-size: .9rem; flex-shrink: 0;
}
.support-cat-label   { flex: 1; font-size: .88rem; font-weight: 500; color: var(--text); }
.support-cat-chevron { color: var(--text-dark); font-size: .75rem; }

.support-form-actions { display: flex; gap: 10px; margin-top: 4px; flex-direction: row-reverse; }

@media (max-width: 768px) {
  .comm-container { height: calc(100vh - 104px); margin-top: 8px; }
  .comm-left { width: 100%; border-right: none; border-bottom: 1px solid var(--border); max-height: 240px; }
  .comm-body { flex-direction: column; }
}

/* ================================================================
   Notification Bell + Dropdown Panel
   ================================================================ */

/* Default: fixed (pages without a topbar) */
.notif-bell-wrap {
  position: fixed;
  top: 14px;
  right: 20px;
  z-index: 1002;
}
/* When slotted inside .topbar-right: flow with the flex row */
.topbar-right .notif-bell-wrap {
  position: relative;
  top: auto;
  right: auto;
  z-index: auto;
}

.notif-bell-btn {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--bg-card2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  position: relative;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.notif-bell-btn:hover,
.notif-bell-btn.active {
  background: var(--gold-dim);
  border-color: rgba(201,162,39,.4);
  color: var(--gold);
}

.notif-badge {
  position: absolute;
  top: -5px; right: -5px;
  min-width: 18px; height: 18px;
  background: #e05252;
  color: #fff;
  border-radius: 9px;
  font-size: .65rem;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px;
  border: 2px solid var(--bg-app);
  line-height: 1;
}

.notif-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 340px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
  z-index: 1003;
}

.notif-panel-head {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.notif-panel-title { font-size: .9rem; font-weight: 700; color: var(--text); }
.notif-panel-new   {
  font-size: .72rem; font-weight: 700;
  color: #e05252; background: rgba(224,82,82,.12);
  border-radius: 20px; padding: 2px 8px;
}

.notif-panel-list { max-height: 320px; overflow-y: auto; }

.notif-panel-empty {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 32px 20px; gap: 10px;
  color: var(--text-muted);
}
.notif-panel-empty i { font-size: 1.8rem; opacity: .3; }
.notif-panel-empty p { font-size: .82rem; }

.notif-panel-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(201,162,39,.07);
  transition: background var(--transition);
}
.notif-panel-item:hover { background: rgba(201,162,39,.06); }

.notif-thumb {
  width: 40px; height: 40px;
  border-radius: 8px; object-fit: cover; flex-shrink: 0;
}
.notif-thumb-icon {
  width: 40px; height: 40px;
  border-radius: 8px; background: var(--gold-dim);
  color: var(--gold); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: .9rem;
}

.notif-panel-item-body    { flex: 1; min-width: 0; }
.notif-panel-item-title   { font-size: .82rem; font-weight: 600; color: var(--text); margin: 4px 0 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notif-panel-item-snippet { font-size: .74rem; color: var(--text-muted); margin-bottom: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notif-panel-item-time    { font-size: .7rem; color: var(--text-dark); }

/* Clickable notification item (message replies) */
a.notif-panel-item-link { text-decoration: none; cursor: pointer; display: flex; }
a.notif-panel-item-link:hover { background: rgba(91,155,213,.08); }

.notif-panel-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  text-align: center;
}
.notif-panel-footer a {
  font-size: .8rem; color: var(--gold); font-weight: 600;
}
.notif-panel-footer a:hover { color: var(--gold-light); }

/* ── Type badge (shared by bell panel + announcement cards) ── */
.notif-type-badge {
  display: inline-block;
  padding: 2px 8px; border-radius: 20px;
  font-size: .65rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em;
  white-space: nowrap;
}
.type-announcements                { color: var(--gold);    background: var(--gold-dim); }
.type-new-products-and-campaigns   { color: var(--info);    background: rgba(91,155,213,.15); }
.type-whats-new, .type-what-s-new  { color: var(--success); background: rgba(76,175,125,.15); }
.type-featured                     { color: #E8600A;        background: rgba(232,96,10,.15); }

/* ================================================================
   Announcements Tab — card feed
   ================================================================ */

.ann-list {
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.ann-card {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.ann-card:hover {
  border-color: rgba(201,162,39,.4);
  box-shadow: 0 2px 16px rgba(0,0,0,.25);
}
.ann-unread {
  border-left: 3px solid var(--gold);
  background: rgba(201,162,39,.04);
}

.ann-thumb {
  width: 72px; height: 72px;
  border-radius: var(--radius);
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--border);
}

.ann-card-body { flex: 1; min-width: 0; }

.ann-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.ann-new-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--gold);
  flex-shrink: 0;
}

.ann-card-date {
  font-size: .73rem;
  color: var(--text-muted);
  background: var(--bg-input);
  padding: 2px 7px;
  border-radius: 4px;
}
.ann-card-by {
  font-size: .73rem;
  color: var(--text-dark);
  font-style: italic;
}

.ann-card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 8px;
  line-height: 1.35;
}
.ann-card-message {
  font-size: .85rem;
  color: var(--text-muted);
  line-height: 1.65;
  margin: 0;
  word-break: break-word;
}
