/* ==========================================================================
   141 HQ — Clean & Professional Executive Dashboard Stylesheet
   ========================================================================== */

.hq-app-container {
  display: flex;
  min-height: 100vh;
  position: relative;
}

/* ==========================================================================
   SIDEBAR NAVIGATION
   ========================================================================== */
.hq-sidebar {
  width: 270px;
  background: var(--bg-panel);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 1100;
  transform: translateX(-100%);
  visibility: hidden;
  pointer-events: none;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.25s;
  box-shadow: none;
}

.sidebar-header {
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-logo {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  box-shadow: none;
  object-fit: contain;
}

.sidebar-title-group h2 {
  font-size: 1.15rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 6px;
}

.sidebar-title-group h2 span {
  color: var(--brand-500);
}

.sidebar-title-group p {
  font-size: 0.7rem;
  color: var(--zinc-400);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.sidebar-menu {
  flex: 1;
  padding: 16px 10px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.menu-section-label {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--zinc-500);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 12px 14px 4px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  color: var(--zinc-400);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all var(--transition);
  cursor: pointer;
  border: 1px solid transparent;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.04);
  color: #ffffff;
}

.nav-link.active {
  background: rgba(229, 9, 20, 0.12);
  color: #ffffff;
  font-weight: 600;
  border-color: rgba(229, 9, 20, 0.3);
}

.nav-icon {
  width: 18px;
  height: 18px;
  stroke-width: 2;
  flex-shrink: 0;
}

.nav-badge {
  margin-left: auto;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.06);
  color: var(--zinc-300);
}

.nav-badge.live {
  background: rgba(229, 9, 20, 0.2);
  color: #f87171;
}

/* User Session Footer */
.sidebar-footer {
  padding: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: #111114;
}

.operative-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  margin-bottom: 10px;
}

.op-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--brand-500);
  background: #18181b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: #ffffff;
  flex-shrink: 0;
}

.op-details {
  flex: 1;
  min-width: 0;
}

.op-name {
  font-size: 0.825rem;
  font-weight: 600;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.op-role {
  font-size: 0.7rem;
  color: var(--brand-400);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-logout {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(244, 63, 94, 0.08);
  color: #fb7185;
  border: 1px solid rgba(244, 63, 94, 0.2);
  padding: 8px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-logout:hover {
  background: rgba(244, 63, 94, 0.16);
  color: #ffffff;
}

/* ==========================================================================
   MAIN CONTENT AREA
   ========================================================================== */
.hq-main-wrapper {
  margin-left: 0;
  width: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* Top Command Bar */
.hq-topbar {
  height: 64px;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(18, 18, 20, 0.75);
  backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 90;
}

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

.topbar-brand,
.mobile-topbar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: #ffffff;
  flex-shrink: 0;
}

.topbar-brand-logo,
.mobile-topbar-logo {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  object-fit: contain;
  display: block;
}

.topbar-brand-title,
.mobile-topbar-title {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #ffffff;
  white-space: nowrap;
}

.topbar-brand-title span,
.mobile-topbar-title span {
  color: var(--brand-500);
}

.page-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.02em;
  padding-left: 8px;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.global-search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  padding: 6px 14px;
  width: 260px;
  transition: all var(--transition);
}

.global-search-box:focus-within {
  background: rgba(255, 255, 255, 0.07);
  border-color: var(--brand-500);
  width: 320px;
}

.global-search-box input {
  background: transparent;
  border: none;
  color: #ffffff;
  font-size: 0.8rem;
  outline: none;
  width: 100%;
}

.global-search-box input::placeholder {
  color: var(--zinc-500);
}

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

.telemetry-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  padding: 5px 12px;
  font-size: 0.75rem;
  color: var(--zinc-400);
}

.clock-display {
  color: var(--brand-400);
  font-weight: 600;
  font-family: var(--font-mono);
}

/* Live QC Wallet Pill */
.topbar-qc-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 5px 10px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  color: #f4f4f5;
  text-decoration: none;
  transition: border-color var(--transition), background-color var(--transition);
  cursor: pointer;
  flex-shrink: 0;
}

.topbar-qc-pill:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.2);
}

.topbar-qc-pill img.qc-icon,
.qc-icon {
  width: 16px;
  height: 16px;
  object-fit: contain;
  vertical-align: middle;
  display: inline-block;
  flex-shrink: 0;
}

.topbar-qc-pill .qc-balance {
  color: #ffffff;
}

.topbar-qc-pill .qc-unit {
  color: var(--brand-500);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
}

.topbar-qc-pill .qc-add-icon {
  background: rgba(229, 9, 20, 0.2);
  color: #f87171;
  border-radius: 2px;
  padding: 0 4px;
  font-size: 0.75rem;
  font-weight: 800;
  margin-left: 2px;
}

/* Content Container */
.hq-content-view {
  padding: 24px 32px 48px;
  flex: 1;
  max-width: 1440px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}

.view-section {
  display: none;
  animation: fadeIn 0.2s ease forwards;
}

.view-section.active-view {
  display: block;
}

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

/* Mobile-only action button hidden on desktop, except universal kebab button */
.mobile-action-btn:not(.mobile-topbar-kebab-btn):not(.hq-kebab-btn) {
  display: none !important;
}

.mobile-topbar-kebab-btn,
.hq-kebab-btn {
  display: flex !important;
}

/* ==========================================================================
   METRICS & KPI ROW
   ========================================================================== */
.metrics-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}

@media (max-width: 1200px) {
  .metrics-row {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 860px) {
  .metrics-row {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 12px;
  }
}

.metric-card {
  background: #14151b;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform var(--transition), border-color var(--transition);
  min-height: 105px;
}

.metric-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.16);
}

.metric-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.metric-title {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--zinc-400);
}

.metric-value {
  font-size: 1.65rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.02em;
  font-family: var(--font-mono);
}

.metric-progress-bg {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  margin-top: 10px;
  overflow: hidden;
}

.metric-progress-bar {
  height: 100%;
  background: var(--brand-500);
  border-radius: var(--radius-full);
  transition: width 0.4s ease;
}

.metric-sub {
  font-size: 0.72rem;
  color: var(--zinc-500);
  margin-top: 4px;
}

/* ==========================================================================
   GRID PANELS & CARDS
   ========================================================================== */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

@media (max-width: 1024px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

.content-panel {
  background: #14151b;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.panel-title {
  font-size: 1rem;
  font-weight: 600;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Table Design */
.hq-table-wrap {
  overflow-x: auto;
}

.hq-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.85rem;
}

.hq-table th {
  padding: 10px 14px;
  color: var(--zinc-400);
  font-weight: 600;
  font-size: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.hq-table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--zinc-300);
}

.hq-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
  color: #ffffff;
}

/* Category Progress Rows */
.category-stat-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.category-stat-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--zinc-300);
}

/* ==========================================================================
   STRATEGIC PLANNING TREE CANVAS (MINDMAP)
   ========================================================================== */
.tree-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.tree-canvas-container {
  width: 100%;
  height: 540px;
  background: #101013;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
  user-select: none;
}

.tree-svg-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.tree-node {
  position: absolute;
  padding: 10px 16px;
  background: #14151b;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  cursor: grab;
  min-width: 160px;
  box-shadow: none;
  transition: border-color var(--transition);
  z-index: 10;
}

.tree-node:hover {
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: none;
}

.tree-node.node-root {
  border-color: #3b82f6;
  background: #151c2c;
}

.tree-node.node-target {
  border-color: #f59e0b;
  background: #231c12;
}

.node-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: #ffffff;
}

.node-status {
  font-size: 0.7rem;
  color: var(--brand-400);
  margin-top: 3px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ==========================================================================
   NOTES TWO-PANE LAYOUT
   ========================================================================== */
.notes-container {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 20px;
  height: 600px;
}

.notes-list-pane {
  background: rgba(24, 24, 27, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.notes-list-header {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.notes-search {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.notes-scroll-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.note-item-card {
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
  transition: all var(--transition);
}

.note-item-card:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.08);
}

.note-item-card.active {
  background: rgba(20, 184, 166, 0.12);
  border-color: rgba(20, 184, 166, 0.3);
}

.note-editor-pane {
  background: rgba(24, 24, 27, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  padding: 22px;
}

/* ==========================================================================
   FILE VAULT
   ========================================================================== */
.file-dropzone {
  border: 2px dashed rgba(20, 184, 166, 0.35);
  border-radius: var(--radius-lg);
  padding: 32px 20px;
  text-align: center;
  background: rgba(20, 184, 166, 0.02);
  cursor: pointer;
  transition: all var(--transition);
  margin-bottom: 20px;
}

.file-dropzone:hover, .file-dropzone.drag-active {
  background: rgba(20, 184, 166, 0.06);
  border-color: var(--brand-400);
}

/* ==========================================================================
   CHAT / COMMS
   ========================================================================== */
.chat-container {
  display: flex;
  flex-direction: column;
  height: 540px;
  background: rgba(24, 24, 27, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.chat-header {
  padding: 14px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #141417;
}

.channel-selector {
  display: flex;
  gap: 6px;
}

.channel-btn {
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 5px 10px;
  font-size: 0.78rem;
  color: var(--zinc-400);
  cursor: pointer;
  transition: all var(--transition);
}

.channel-btn.active {
  background: rgba(20, 184, 166, 0.15);
  color: var(--brand-400);
  border-color: rgba(20, 184, 166, 0.3);
}

.chat-messages {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.chat-bubble {
  display: flex;
  gap: 10px;
  max-width: 75%;
}

.chat-bubble.mine {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.chat-bubble-content {
  display: flex;
  flex-direction: column;
}

.chat-meta {
  font-size: 0.7rem;
  color: var(--zinc-500);
  margin-bottom: 3px;
}

.chat-bubble.mine .chat-meta {
  text-align: right;
}

.chat-text {
  background: #27272a;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  padding: 9px 13px;
  font-size: 0.875rem;
  color: #f4f4f5;
  line-height: 1.4;
}

.chat-bubble.mine .chat-text {
  background: rgba(20, 184, 166, 0.18);
  border-color: rgba(20, 184, 166, 0.35);
}

.chat-input-bar {
  padding: 14px 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  gap: 10px;
  background: #141417;
}

/* ==========================================================================
   DAY TO DAY ACTIVITY
   ========================================================================== */
.activity-card-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  transition: all var(--transition);
}

.activity-card-item:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
}

.activity-time-badge {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--brand-400);
  width: 52px;
}

/* ==========================================================================
   HAMBURGER MENU & RESPONSIVE SIDEBAR DRAWER
   ========================================================================== */

.btn-hamburger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: transparent;
  border: none;
  border-radius: 50%;
  color: #ffffff;
  cursor: pointer;
  padding: 0;
  transition: background-color 0.15s ease;
  flex-shrink: 0;
  outline: none;
}

.btn-hamburger:hover {
  background: rgba(255, 255, 255, 0.1);
}

.btn-hamburger:active {
  background: rgba(255, 255, 255, 0.18);
}

.btn-hamburger svg {
  width: 22px;
  height: 22px;
  stroke: #ffffff;
}

/* Sidebar Backdrop (YouTube Guide Scrim) */
.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  cursor: pointer;
  transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.25s;
}

.sidebar-backdrop.active,
.sidebar-backdrop.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* Sidebar Header & YouTube-style In-Drawer Hamburger */
.sidebar-header {
  padding: 0 16px;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-sizing: border-box;
}

.sidebar-hamburger-btn {
  margin-right: 4px;
}

/* Sidebar Drawer Close Button */
.sidebar-close-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: transparent;
  border: none;
  color: var(--zinc-400);
  cursor: pointer;
  padding: 0;
  border-radius: 50%;
  margin-left: auto;
  transition: background-color 0.15s ease, color 0.15s ease;
}

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

.sidebar-close-btn svg {
  width: 18px;
  height: 18px;
}

/* YouTube Overlay Drawer Active State */
.hq-sidebar.drawer-open,
.hq-sidebar.open {
  transform: translateX(0) !important;
  visibility: visible !important;
  pointer-events: auto !important;
  box-shadow: 4px 0 32px rgba(0, 0, 0, 0.75) !important;
}

@media (max-width: 768px) {
  .hq-topbar {
    padding: 0 16px;
  }
  .hq-content-view {
    padding: 20px 16px;
  }
  .global-search-box {
    display: none;
  }
}

/* ==========================================================================
   TOP-RIGHT USER PROFILE DROPDOWN
   ========================================================================== */
.topbar-user-wrap {
  position: relative;
}

.topbar-profile-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  padding: 4px 14px 4px 6px;
  cursor: pointer;
  transition: all var(--transition);
}

.topbar-profile-btn:hover, .topbar-profile-btn.active {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(20, 184, 166, 0.35);
}

.topbar-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.78rem;
  box-shadow: none;
}

.topbar-user-meta {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.topbar-user-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: #ffffff;
  line-height: 1.2;
}

.topbar-user-role {
  font-size: 0.68rem;
  color: var(--brand-400);
  line-height: 1.2;
}

/* Dropdown Menu */
.profile-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 270px;
  background: #141417;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  box-shadow: 0 16px 36px -4px rgba(0, 0, 0, 0.65);
  padding: 8px;
  z-index: 1000;
  display: none;
  animation: fadeIn 0.18s ease forwards;
}

.profile-dropdown-menu.show,
.profile-dropdown-menu.active,
.profile-dropdown-menu.open {
  display: block !important;
}

.profile-dropdown-header {
  padding: 10px 10px 12px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 6px;
}

.profile-dropdown-user-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.profile-dropdown-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #27272a;
  border: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: #ffffff;
  flex-shrink: 0;
}

.profile-dropdown-info {
  min-width: 0;
  flex: 1;
}

.profile-dropdown-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: #ffffff;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-dropdown-email {
  font-size: 0.72rem;
  color: var(--zinc-400);
  word-break: break-all;
  margin-top: 2px;
}

.profile-dropdown-badge-row {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.profile-dropdown-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin: 6px 0;
}

.profile-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-md);
  font-size: 0.825rem;
  font-weight: 500;
  color: var(--zinc-300);
  text-decoration: none;
  cursor: pointer;
  transition: all var(--transition);
  background: transparent;
  border: none;
  width: 100%;
  text-align: left;
}

.profile-dropdown-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
}

.profile-dropdown-item.danger {
  color: #fb7185;
}

.profile-dropdown-item.danger:hover {
  background: rgba(244, 63, 94, 0.12);
  color: #f43f5e;
}

/* ==========================================================================
   ADVANCED EXPENSE TRACKER & PAYMENT REQUEST TABS
   ========================================================================== */
.tracker-subtabs {
  display: flex;
  gap: 8px;
  background: rgba(255, 255, 255, 0.03);
  padding: 4px;
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  width: fit-content;
}

.tracker-subtab-btn {
  background: transparent;
  border: none;
  padding: 8px 16px;
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--zinc-400);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
}

.tracker-subtab-btn.active {
  background: var(--brand-600);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(13, 148, 136, 0.3);
}

/* Receipt Status Badges */
.receipt-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.receipt-status-badge.to-be-paid {
  background: rgba(245, 158, 11, 0.14);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.receipt-status-badge.paid {
  background: rgba(16, 185, 129, 0.14);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.receipt-status-badge.cancelled {
  background: rgba(255, 255, 255, 0.06);
  color: var(--zinc-400);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
}

.modal-overlay.open,
.modal-overlay.active,
.modal-overlay.show {
  display: flex !important;
}

.receipt-modal-container {
  width: 100%;
  max-width: 920px;
  background: #141417;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-xl);
  box-shadow: 0 25px 60px -10px rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
  max-height: 90vh;
  overflow: hidden;
}

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

.modal-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #ffffff;
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

/* Luxury Modern Tech Printable Receipt Sheet */
.receipt-sheet {
  background: #ffffff;
  color: #09090b;
  border-radius: 14px;
  padding: 36px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  font-family: var(--font-sans);
  position: relative;
  overflow: hidden;
}

.receipt-sheet-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
  padding-bottom: 18px;
  border-bottom: 2px solid #f4f4f5;
}

.receipt-brand-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.receipt-brand-logo img {
  width: 38px;
  height: 38px;
  border-radius: 8px;
}

.receipt-brand-name {
  font-size: 1.25rem;
  font-weight: 800;
  color: #09090b;
  letter-spacing: -0.02em;
}

.receipt-brand-name span {
  color: var(--brand-600);
}

.receipt-sheet-table {
  width: 100%;
  border-collapse: collapse;
  margin: 18px 0;
}

.receipt-sheet-table th {
  text-align: left;
  padding: 10px 12px;
  background: #f4f4f5;
  color: #52525b;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.receipt-sheet-table td {
  padding: 12px;
  border-bottom: 1px solid #e4e4e7;
  color: #18181b;
  font-size: 0.85rem;
}

/* Payment Box with UPI QR */
.receipt-upi-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 24px;
}

.receipt-qr-wrap {
  background: #ffffff;
  padding: 6px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.receipt-upi-info {
  flex: 1;
}

.receipt-upi-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.receipt-upi-vpa {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--brand-700);
  background: #f0fdfa;
  padding: 4px 8px;
  border-radius: 6px;
  display: inline-block;
  margin: 4px 0;
  border: 1px dashed rgba(20, 184, 166, 0.4);
}

.receipt-upi-hint {
  font-size: 0.75rem;
  color: #64748b;
  margin-top: 4px;
}

@media print {
  body * {
    visibility: hidden;
  }
  .receipt-sheet, .receipt-sheet *,
  .live-invoice-paper, .live-invoice-paper * {
    visibility: visible;
  }
  .receipt-sheet, .live-invoice-paper {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    margin: 0;
    box-shadow: none;
    border: none;
  }
}

/* ==========================================================================
   LIVE DIGITAL INVOICE PAPER & DESIGN THEMES (UNIVERSAL)
   ========================================================================== */
.live-invoice-paper {
  background: #ffffff;
  color: #09090b;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  font-family: var(--font-sans);
}

.live-invoice-paper.font-style-sans { font-family: var(--font-sans); }
.live-invoice-paper.font-style-mono { font-family: var(--font-mono); }
.live-invoice-paper.font-style-serif { font-family: Georgia, Cambria, serif; }

.live-invoice-paper.theme-executive {
  background: #ffffff;
  color: #09090b;
}

.live-invoice-paper.theme-dark {
  background: #0d0f14 !important;
  color: #f1f5f9 !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  box-shadow: 0 16px 40px rgba(0,0,0,0.7) !important;
}
.live-invoice-paper.theme-dark * {
  border-color: rgba(255, 255, 255, 0.1) !important;
}
.live-invoice-paper.theme-dark th {
  background: #161822 !important;
  color: #94a3b8 !important;
}
.live-invoice-paper.theme-dark td {
  color: #e2e8f0 !important;
}
.live-invoice-paper.theme-dark .sheet-title,
.live-invoice-paper.theme-dark .sheet-text-dark {
  color: #ffffff !important;
}
.live-invoice-paper.theme-dark .sheet-upi-box-wrap {
  background: #141620 !important;
  border-color: rgba(20, 184, 166, 0.3) !important;
}

.live-invoice-paper.theme-minimal {
  background: #fafafa !important;
  color: #111111 !important;
  border-radius: 4px !important;
  border: 1px solid #e5e5e5 !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
}
.live-invoice-paper.theme-minimal th {
  background: #111111 !important;
  color: #ffffff !important;
  text-transform: uppercase !important;
  letter-spacing: 0.08em !important;
}

.live-invoice-paper.theme-ivory {
  background: #faf6ee !important;
  color: #1e293b !important;
  border: 2px solid #e2d9c8 !important;
}
.live-invoice-paper.theme-ivory th {
  background: #ede6d6 !important;
  color: #475569 !important;
}

.live-invoice-paper.theme-emerald {
  background: #04120f !important;
  color: #ecfdf5 !important;
  border: 1px solid rgba(16, 185, 129, 0.35) !important;
  box-shadow: 0 16px 40px rgba(0,0,0,0.8), 0 0 25px rgba(16, 185, 129, 0.12) !important;
}
.live-invoice-paper.theme-emerald * {
  border-color: rgba(16, 185, 129, 0.18) !important;
}
.live-invoice-paper.theme-emerald th {
  background: #08241d !important;
  color: #6ee7b7 !important;
}
.live-invoice-paper.theme-emerald td {
  color: #d1fae5 !important;
}
.live-invoice-paper.theme-emerald .sheet-title,
.live-invoice-paper.theme-emerald .sheet-text-dark {
  color: #ffffff !important;
}
.live-invoice-paper.theme-emerald .sheet-upi-box-wrap {
  background: #081f18 !important;
  border-color: rgba(16, 185, 129, 0.45) !important;
}

.live-invoice-paper.theme-obsidian {
  background: #0a0d17 !important;
  color: #f8fafc !important;
  border: 1px solid rgba(245, 158, 11, 0.3) !important;
  box-shadow: 0 16px 40px rgba(0,0,0,0.8), 0 0 25px rgba(245, 158, 11, 0.1) !important;
}
.live-invoice-paper.theme-obsidian * {
  border-color: rgba(245, 158, 11, 0.15) !important;
}
.live-invoice-paper.theme-obsidian th {
  background: #13192b !important;
  color: #fbbf24 !important;
}
.live-invoice-paper.theme-obsidian td {
  color: #f1f5f9 !important;
}
.live-invoice-paper.theme-obsidian .sheet-title,
.live-invoice-paper.theme-obsidian .sheet-text-dark {
  color: #ffffff !important;
}
.live-invoice-paper.theme-obsidian .sheet-upi-box-wrap {
  background: #111626 !important;
  border-color: rgba(245, 158, 11, 0.4) !important;
}

.live-invoice-paper.theme-blueprint {
  background: #f0f9ff !important;
  color: #0c4a6e !important;
  border: 2px dashed #0284c7 !important;
  font-family: var(--font-mono) !important;
}
.live-invoice-paper.theme-blueprint th {
  background: #e0f2fe !important;
  color: #0369a1 !important;
  border-bottom: 2px solid #0284c7 !important;
}
.live-invoice-paper.theme-blueprint td {
  border-bottom: 1px dashed #bae6fd !important;
  color: #0c4a6e !important;
}
.live-invoice-paper.theme-blueprint .sheet-title,
.live-invoice-paper.theme-blueprint .sheet-text-dark {
  color: #0369a1 !important;
}
.live-invoice-paper.theme-blueprint .sheet-upi-box-wrap {
  background: #e0f2fe !important;
  border-color: #0284c7 !important;
}

.live-invoice-paper.theme-corporate {
  background: #ffffff !important;
  color: #0f172a !important;
  border: 1px solid #cbd5e1 !important;
  border-top: 4px solid #1e3a8a !important;
}
.live-invoice-paper.theme-corporate th {
  background: #1e3a8a !important;
  color: #ffffff !important;
}
.live-invoice-paper.theme-corporate td {
  border-bottom: 1px solid #e2e8f0 !important;
  color: #0f172a !important;
}
.live-invoice-paper.theme-corporate .sheet-title,
.live-invoice-paper.theme-corporate .sheet-text-dark {
  color: #1e3a8a !important;
}
.live-invoice-paper.theme-corporate .sheet-upi-box-wrap {
  background: #f8fafc !important;
  border-color: #94a3b8 !important;
}

.live-invoice-paper.theme-parchment {
  background: #fbf7ee !important;
  color: #451a03 !important;
  border: 1px solid #d97706 !important;
  font-family: Georgia, serif !important;
}
.live-invoice-paper.theme-parchment th {
  background: #fef3c7 !important;
  color: #78350f !important;
}
.live-invoice-paper.theme-parchment td {
  border-bottom: 1px solid #fde68a !important;
  color: #451a03 !important;
}
.live-invoice-paper.theme-parchment .sheet-title,
.live-invoice-paper.theme-parchment .sheet-text-dark {
  color: #78350f !important;
}
.live-invoice-paper.theme-parchment .sheet-upi-box-wrap {
  background: #fef3c7 !important;
  border-color: #d97706 !important;
}

.live-invoice-paper.theme-slate {
  background: #f8fafc !important;
  color: #1e293b !important;
  border: 1px solid #94a3b8 !important;
  border-top: 4px solid #334155 !important;
}
.live-invoice-paper.theme-slate th {
  background: #334155 !important;
  color: #f8fafc !important;
}
.live-invoice-paper.theme-slate td {
  border-bottom: 1px solid #e2e8f0 !important;
  color: #1e293b !important;
}
.live-invoice-paper.theme-slate .sheet-title,
.live-invoice-paper.theme-slate .sheet-text-dark {
  color: #0f172a !important;
}
.live-invoice-paper.theme-slate .sheet-upi-box-wrap {
  background: #f1f5f9 !important;
  border-color: #94a3b8 !important;
}

.live-invoice-paper.theme-crimson {
  background: #fffafa !important;
  color: #4c0519 !important;
  border: 1.5px solid #881337 !important;
}
.live-invoice-paper.theme-crimson th {
  background: #881337 !important;
  color: #ffffff !important;
}
.live-invoice-paper.theme-crimson td {
  border-bottom: 1px solid #fecdd3 !important;
  color: #881337 !important;
}
.live-invoice-paper.theme-crimson .sheet-title,
.live-invoice-paper.theme-crimson .sheet-text-dark {
  color: #881337 !important;
}
.live-invoice-paper.theme-crimson .sheet-upi-box-wrap {
  background: #fff1f2 !important;
  border-color: #f43f5e !important;
}

.live-invoice-paper.theme-oldschool {
  background: #faf7ee !important;
  color: #1a1a1a !important;
  border: 1px dashed #555555 !important;
  border-top: 4px dashed #333333 !important;
  border-bottom: 4px dashed #333333 !important;
  font-family: "Courier New", Courier, monospace !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15) !important;
  letter-spacing: 0.02em !important;
}
.live-invoice-paper.theme-oldschool th {
  background: #ece7d5 !important;
  color: #111111 !important;
  border-top: 1px dashed #555555 !important;
  border-bottom: 1px dashed #555555 !important;
  font-family: "Courier New", Courier, monospace !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
}
.live-invoice-paper.theme-oldschool td {
  border-bottom: 1px dotted #888888 !important;
  color: #1a1a1a !important;
  font-family: "Courier New", Courier, monospace !important;
}
.live-invoice-paper.theme-oldschool .sheet-title,
.live-invoice-paper.theme-oldschool .sheet-text-dark {
  color: #000000 !important;
  font-family: "Courier New", Courier, monospace !important;
  font-weight: 800 !important;
  letter-spacing: 0.08em !important;
}
.live-invoice-paper.theme-oldschool .sheet-upi-box-wrap {
  background: #f0ebd8 !important;
  border: 1px dashed #777777 !important;
}

/* ==========================================================================
   HQ Enterprise Unified Table & Filter Design System (Cross-Page Standard)
   ========================================================================== */

.filter-pill-group {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.filter-pill {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--zinc-400);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}
.filter-pill:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}
.filter-pill.active {
  background: var(--brand-500);
  color: #09090b;
  border-color: var(--brand-500);
  font-weight: 700;
}

.hq-table-scroll-container {
  max-height: 560px;
  overflow-y: auto;
  overflow-x: auto;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius-md);
  background: rgba(14, 15, 19, 0.6);
  position: relative;
}
.hq-table-scroll-container::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
.hq-table-scroll-container::-webkit-scrollbar-track {
  background: rgba(18, 18, 23, 0.6);
}
.hq-table-scroll-container::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 9999px;
}
.hq-table-scroll-container::-webkit-scrollbar-thumb:hover {
  background: var(--brand-500);
}
.hq-table-scroll-container thead th {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #14151b !important;
  backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08);
}
.hq-table tbody tr {
  transition: background 0.12s ease;
}
.hq-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.035);
}

.nature-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.nature-purchased {
  background: rgba(255, 255, 255, 0.06);
  color: #e4e4e7;
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.nature-lended {
  background: rgba(99, 102, 241, 0.12);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.3);
}
.nature-borrowed {
  background: rgba(229, 9, 20, 0.12);
  color: #f87171;
  border: 1px solid rgba(229, 9, 20, 0.3);
}
.nature-repaid, .nature-profit {
  background: rgba(34, 197, 94, 0.12);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.35);
}

.status-cell-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  transition: all 0.2s ease;
  white-space: nowrap;
  user-select: none;
  line-height: 1.2;
}
.status-cell-btn.status-repaid, .status-cell-btn.status-completed {
  background: rgba(34, 197, 94, 0.12);
  color: #34d399;
  border: 1px solid rgba(34, 197, 94, 0.3);
}
.status-cell-btn.status-tobepaid, .status-cell-btn.status-pending {
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
}
.status-cell-btn.status-unpaid, .status-cell-btn.status-failed {
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.tx-page-btn {
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #18181b;
  color: #a1a1aa;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}
.tx-page-btn:hover:not(:disabled) {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.25);
}
.tx-page-btn.active {
  background: var(--brand-500);
  color: #09090b;
  border-color: var(--brand-500);
  font-weight: 700;
}
.tx-page-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

