@import url('./variables.css');

/* ==========================================================================
   1. Base & Reset (Blueprint Rules)
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

html {
  font-size: 14px;
  scroll-behavior: smooth;
  overflow-y: scroll;
  scrollbar-gutter: stable; /* Blueprint Rule: Prevents layout shift */
}

body {
  font-family: var(--font-english);
  background-color: var(--bg-app);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  transition: background-color var(--transition-normal), color var(--transition-normal);
}

/* LTR Support - English Typography (Inter) */
[dir="ltr"], [lang="en"], :lang(en) {
  font-family: var(--font-english);
}

/* RTL Support - Direction Aware Arabic Typography (IBM Plex Sans Arabic) */
[dir="rtl"], [lang="ar"], :lang(ar) {
  direction: rtl;
  text-align: right;
  font-family: var(--font-arabic);
}

[dir="rtl"] :is(h1, h2, h3, h4, h5, h6, .brand-title, .panel-title, .page-title, .card-title, .modal-title),
[lang="ar"] :is(h1, h2, h3, h4, h5, h6, .brand-title, .panel-title, .page-title, .card-title, .modal-title) {
  font-family: var(--font-arabic);
  font-weight: 700;
}

[dir="rtl"] p,
[dir="rtl"] .prose,
[dir="rtl"] article {
  line-height: 1.65;
}

/* Custom Gold Scrollbar (Blueprint Section 11) */
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}

::-webkit-scrollbar-track {
  background: rgba(12, 14, 18, 0.4);
}

::-webkit-scrollbar-thumb {
  background: rgba(212, 175, 55, 0.35);
  border-radius: 9999px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(212, 175, 55, 0.7);
}

/* Focus Visibility Standard */
*:focus-visible {
  outline: 2px solid transparent;
  outline-offset: 2px;
  box-shadow: 0 0 0 2px var(--gold-primary);
}

/* ==========================================================================
   2. Desktop Sidebar Navigation (> 1024px)
   ========================================================================== */
.sidebar {
  width: 250px;
  flex-shrink: 0;
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 1.25rem 1rem;
  z-index: 100;
  transition: width var(--transition-normal), transform var(--transition-normal);
}

[dir="rtl"] .sidebar {
  border-right: none;
  border-left: 1px solid var(--border-subtle);
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-subtle);
}

.brand-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: var(--gold-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #0c0e12;
  font-weight: 800;
  font-size: 1.15rem;
  box-shadow: 0 4px 12px rgba(212, 175, 55, 0.3);
  flex-shrink: 0;
}

.brand-title {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
}

.brand-title span {
  font-size: 0.7rem;
  text-transform: uppercase;
  color: var(--gold-primary);
  font-family: var(--font-sans);
  letter-spacing: 0.08em;
}

.brand-subtitle {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.terminal-badge {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.4rem 0.65rem;
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  margin-bottom: 1.25rem;
  font-size: 0.75rem;
  font-weight: 600;
}

.live-indicator {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--emerald-live);
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--emerald-live);
  box-shadow: 0 0 8px var(--emerald-live);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { opacity: 0.6; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.15); }
  100% { opacity: 0.6; transform: scale(0.9); }
}

.nav-group-title {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin: 0.85rem 0 0.4rem 0.5rem;
}

.nav-menu {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex-grow: 1;
}

.nav-item button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: left;
}

[dir="rtl"] .nav-item button {
  text-align: right;
}

.nav-item button:hover {
  background: var(--bg-surface-elevated);
  color: var(--text-main);
  border-color: var(--border-subtle);
}

.nav-item button:hover svg {
  transform: translateX(3px);
}
[dir="rtl"] .nav-item button:hover svg {
  transform: translateX(-3px);
}

.nav-item.active button {
  background: var(--gold-gradient);
  color: #0c0e12;
  font-weight: 700;
  box-shadow: var(--shadow-gold);
}

.nav-item.active button svg {
  stroke: #0c0e12;
}

.sidebar-footer {
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.vault-security-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.35rem 0.6rem;
  background: var(--gold-badge);
  border: 1px solid var(--gold-border);
  border-radius: var(--radius-sm);
  color: var(--gold-primary);
  font-weight: 600;
  font-size: 0.75rem;
}

/* ==========================================================================
   3. Main Content Wrapper & Top Header
   ========================================================================== */
.main-wrapper {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100vh;
  overflow-y: auto;
}

.top-header {
  position: sticky;
  top: 0;
  z-index: 90;
  background-color: var(--bg-header);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.75rem 1.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

/* Hamburger trigger for mobile */
.mobile-hamburger-btn {
  display: none;
  background: transparent;
  border: none;
  color: var(--text-main);
  font-size: 1.4rem;
  cursor: pointer;
  padding: 0.25rem;
}

.ticker-strip {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  font-size: 0.82rem;
  flex-shrink: 0;
}

.ticker-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
}

.ticker-label {
  color: var(--gold-primary);
  font-size: 0.75rem;
}

.ticker-trend {
  color: var(--emerald-live);
  font-size: 0.72rem;
}

.header-search {
  flex-grow: 1;
  max-width: 440px;
  position: relative;
}

.header-search input {
  width: 100%;
  padding: 0.55rem 1rem 0.55rem 2.25rem;
  background-color: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 0.85rem;
  outline: none;
  transition: border-color var(--transition-fast);
}

[dir="rtl"] .header-search input {
  padding: 0.55rem 2.25rem 0.55rem 1rem;
}

.header-search input:focus {
  border-color: var(--gold-primary);
  box-shadow: 0 0 0 2px var(--gold-badge);
}

.search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

[dir="rtl"] .search-icon {
  left: auto;
  right: 0.75rem;
}

.search-badge {
  position: absolute;
  right: 0.6rem;
  top: 50%;
  transform: translateY(-50%);
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-subtle);
  padding: 0.15rem 0.35rem;
  border-radius: 4px;
  font-size: 0.65rem;
  color: var(--text-muted);
}

[dir="rtl"] .search-badge {
  right: auto;
  left: 0.6rem;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.btn-icon {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-icon:hover {
  color: var(--gold-primary);
  border-color: var(--gold-border);
}

.btn-lang {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.3rem 0.65rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
}

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--gold-gradient);
  color: #0c0e12;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  flex-shrink: 0;
}

.user-info {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.user-name {
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
}

.user-boutique {
  font-size: 0.68rem;
  color: var(--text-muted);
  white-space: nowrap;
}

/* ==========================================================================
   4. View Containers & Common Layout
   ========================================================================== */
.view-container {
  padding: 1.75rem;
  display: none;
  animation: fadeIn 0.25s ease forwards;
  max-width: 1600px;
  width: 100%;
  margin: 0 auto;
}

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

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

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.page-eyebrow {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--gold-primary);
  letter-spacing: 0.08em;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.page-title {
  font-family: var(--font-serif);
  font-size: 1.85rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: 0.02em;
}

.page-subtitle {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-top: 0.2rem;
}

.page-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem 1.15rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  border: 1px solid transparent;
  white-space: nowrap;
}

.btn-primary {
  background: var(--gold-gradient);
  color: #0c0e12;
  box-shadow: 0 4px 12px rgba(212, 175, 55, 0.25);
}

.btn-primary:hover {
  filter: brightness(1.08);
  box-shadow: 0 6px 16px rgba(212, 175, 55, 0.35);
  transform: translateY(-2px);
}

.btn-secondary {
  background: var(--bg-surface);
  border-color: var(--border-subtle);
  color: var(--text-main);
}

.btn-secondary:hover {
  border-color: var(--gold-border);
  color: var(--gold-primary);
}

.btn-outline-gold {
  background: transparent;
  border-color: var(--gold-primary);
  color: var(--gold-primary);
}

.btn-outline-gold:hover {
  background: var(--gold-badge);
}

/* ==========================================================================
   5. Metric Cards Grid
   ========================================================================== */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.metric-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.metric-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-highlight);
}

.metric-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold-primary), transparent);
  opacity: 0.7;
}

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

.metric-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-secondary);
  font-weight: 600;
  letter-spacing: 0.05em;
}

.metric-badge {
  font-size: 0.72rem;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  background: var(--emerald-bg);
  color: var(--emerald-live);
  font-weight: 600;
}

.metric-val {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.metric-val small {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--gold-primary);
}

.metric-footer {
  margin-top: 0.6rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* ==========================================================================
   6. Dashboard Tri-Grid & Components
   ========================================================================== */
.dashboard-tri-grid {
  display: grid;
  grid-template-columns: 320px 1fr 340px;
  gap: 1.25rem;
}

.card-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.panel-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.masterpiece-card {
  position: relative;
  text-align: center;
}

.masterpiece-image-wrap {
  width: 100%;
  height: 230px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 1rem;
  background: #000;
}

.masterpiece-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.masterpiece-image-wrap:hover img {
  transform: scale(1.04);
}

.masterpiece-title {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  color: var(--gold-light);
  margin-bottom: 0.25rem;
}

.masterpiece-spec {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.masterpiece-breakdown {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.85rem;
  margin-bottom: 1.25rem;
  text-align: left;
}

[dir="rtl"] .masterpiece-breakdown {
  text-align: right;
}

.breakdown-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
}

.breakdown-val {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  margin-top: 0.15rem;
}

/* Production Pipeline */
.pipeline-steps {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1rem;
  position: relative;
}

.pipeline-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  position: relative;
  z-index: 2;
}

.step-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-surface-elevated);
  border: 2px solid var(--gold-border);
  color: var(--gold-primary);
  font-weight: 700;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.step-circle.active {
  background: var(--gold-gradient);
  color: #0c0e12;
  border-color: var(--gold-primary);
}

.step-label {
  font-size: 0.7rem;
  color: var(--text-secondary);
}

/* ==========================================================================
   7. POS Counter & Cart Registry
   ========================================================================== */
.pos-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 1.5rem;
}

.pos-catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 1.25rem;
}

.jewelry-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.jewelry-card:hover {
  transform: translateY(-3px);
  border-color: var(--gold-border);
  box-shadow: var(--shadow-md);
}

.jewelry-thumb {
  width: 100%;
  height: 150px;
  position: relative;
  background: #000;
}

.jewelry-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.karat-badge {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  background: rgba(12, 14, 18, 0.85);
  border: 1px solid var(--gold-border);
  color: var(--gold-primary);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
}

[dir="rtl"] .karat-badge {
  left: auto;
  right: 0.5rem;
}

.weight-badge {
  position: absolute;
  bottom: 0.5rem;
  right: 0.5rem;
  background: rgba(12, 14, 18, 0.8);
  color: #fff;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 500;
}

[dir="rtl"] .weight-badge {
  right: auto;
  left: 0.5rem;
}

.jewelry-details {
  padding: 0.9rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.jewelry-name {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 0.35rem;
  line-height: 1.25;
}

.jewelry-sku {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 0.65rem;
}

.jewelry-price-row {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.65rem;
  border-top: 1px solid var(--border-subtle);
}

.price-tag {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--gold-primary);
}

.price-tag small {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* Cart Panel */
.cart-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  height: calc(100vh - 120px);
  position: sticky;
  top: 80px;
}

.cart-items-list {
  flex-grow: 1;
  overflow-y: auto;
  margin: 1rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 280px;
}

.cart-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem;
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
}

.cart-item-name {
  font-weight: 600;
  color: var(--text-main);
}

.cart-item-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.cart-calculations-box {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 1rem;
  margin-bottom: 1rem;
  font-size: 0.82rem;
}

.calc-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.25rem 0;
  color: var(--text-secondary);
}

.calc-line.total-line {
  border-top: 1px solid var(--border-card);
  padding-top: 0.75rem;
  margin-top: 0.5rem;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--gold-primary);
}

/* ==========================================================================
   8. Inventory Table & Responsiveness
   ========================================================================== */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.vault-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.85rem;
  min-width: 650px; /* guarantees headers don't cramp */
}

[dir="rtl"] .vault-table {
  text-align: right;
}

.vault-table th {
  background: var(--bg-surface-subtle);
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-card);
  white-space: nowrap;
}

.vault-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-main);
  vertical-align: middle;
}

.vault-table tr:hover td {
  background: var(--bg-surface-elevated);
}

/* ==========================================================================
   9. Mobile Bottom Taskbar & Backdrop (Blueprint Pattern)
   ========================================================================== */
.mobile-bottom-taskbar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background-color: var(--bg-header);
  border-top: 1px solid var(--border-subtle);
  z-index: 900;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding: 0 0.5rem;
}

.mobile-taskbar-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  height: 100%;
}

.mobile-taskbar-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
}

.mobile-taskbar-btn.active {
  color: var(--gold-primary);
}

.mobile-taskbar-btn svg {
  width: 20px;
  height: 20px;
}

/* Mobile Sidebar Overlay Backdrop */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 950;
}

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

/* ==========================================================================
   10. Modals
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-backdrop.active {
  display: flex;
}

.modal-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  max-width: 580px;
  width: 100%;
  padding: 1.75rem;
  box-shadow: var(--shadow-lg);
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
}

.modal-title {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  color: var(--gold-primary);
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
}

.form-input, .form-select {
  width: 100%;
  padding: 0.6rem 0.85rem;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 0.85rem;
  outline: none;
}

.form-input:focus, .form-select:focus {
  border-color: var(--gold-primary);
}

/* ==========================================================================
   11. Responsive Breakpoints (Mobile-First Trio Pattern from Blueprint)
   ========================================================================== */

/* Tablet & Intermediate (< 1024px) */
@media (max-width: 1024px) {
  .dashboard-tri-grid {
    grid-template-columns: 1fr;
  }

  .pos-layout {
    grid-template-columns: 1fr;
  }

  .cart-panel {
    position: static;
    height: auto;
    margin-top: 1.5rem;
  }

  .metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .sidebar {
    width: 220px;
  }
}

/* Mobile Devices (< 768px) */
@media (max-width: 768px) {
  body {
    flex-direction: column;
    padding-bottom: 60px; /* Space for bottom taskbar */
  }

  /* Slide-out Sidebar Drawer */
  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: 280px;
    height: 100vh;
    transform: translateX(-100%);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    background-color: var(--bg-sidebar);
  }

  [dir="rtl"] .sidebar {
    left: auto;
    right: 0;
    transform: translateX(100%);
  }

  .sidebar.mobile-open {
    transform: translateX(0);
  }

  /* Show Hamburger Button */
  .mobile-hamburger-btn {
    display: block;
  }

  /* Top Header on Mobile */
  .top-header {
    padding: 0.65rem 1rem;
    gap: 0.5rem;
  }

  .ticker-strip {
    display: none; /* Hidden on tiny screens, accessible inside Gold Engine */
  }

  .header-search {
    max-width: 180px;
  }

  .user-info {
    display: none; /* Show only avatar on mobile */
  }

  /* Show Bottom Taskbar */
  .mobile-bottom-taskbar {
    display: block;
  }

  /* Single Column Metrics */
  .metrics-grid {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }

  .view-container {
    padding: 1rem;
  }

  .page-title {
    font-size: 1.45rem;
  }

  .pos-catalog-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.85rem;
  }

  .masterpiece-image-wrap {
    height: 180px;
  }
}

/* Tiny Mobile Screens (< 480px) */
@media (max-width: 480px) {
  .header-search {
    display: none; /* Frees header space on extra small phones */
  }

  .pos-catalog-grid {
    grid-template-columns: 1fr;
  }

  .masterpiece-breakdown {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
}

/* ==========================================================================
   11b. Confidential Masking & Employee Dashboard Enhancements
   ========================================================================== */
.confidential-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  font-family: var(--font-sans);
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.12);
  border: 1px dashed rgba(245, 158, 11, 0.35);
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-sm);
  backdrop-filter: blur(4px);
  user-select: none;
}

.employee-only-banner {
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.1) 0%, rgba(212, 175, 55, 0.08) 100%);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
}

.scale-pulse {
  animation: scaleGlow 0.8s ease-in-out infinite alternate;
}

@keyframes scaleGlow {
  0% {
    color: var(--emerald-live);
    text-shadow: 0 0 4px rgba(16, 185, 129, 0.4);
  }
  100% {
    color: #34d399;
    text-shadow: 0 0 12px rgba(16, 185, 129, 0.9);
  }
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  pointer-events: none;
}

[dir="rtl"] .toast-container {
  right: auto;
  left: 1.5rem;
}

.toast {
  pointer-events: auto;
  min-width: 280px;
  max-width: 420px;
  background: var(--bg-surface);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1.15rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
  color: var(--text-main);
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  animation: toastSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.toast-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.toast-success {
  border-color: rgba(16, 185, 129, 0.5);
}

.toast-info {
  border-color: var(--gold-primary);
}

.toast-warning {
  border-color: #f59e0b;
}

/* Filter Chips */
.filter-chip-group {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
}

.filter-chip {
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.filter-chip.active, .filter-chip:hover {
  background: rgba(212, 175, 55, 0.15);
  border-color: var(--gold-primary);
  color: var(--gold-primary);
}

/* ==========================================================================
   12. Print Stylesheet (Blueprint Section 16)
   ========================================================================== */
@media print {
  @page { size: A4 portrait; margin: 12mm; }

  body {
    background: #ffffff !important;
    color: #000000 !important;
    font-size: 11pt !important;
    padding: 0 !important;
  }

  aside, header, nav, .mobile-bottom-taskbar, .btn-icon, .btn-lang, .mobile-hamburger-btn,
  #view-dashboard, #view-inventory, #view-gold-engine, .cart-panel, .page-actions {
    display: none !important;
  }

  .modal-backdrop.active {
    position: static !important;
    background: transparent !important;
    backdrop-filter: none !important;
    display: block !important;
    padding: 0 !important;
  }

  .modal-box {
    box-shadow: none !important;
    border: none !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
  }
}

/* ==========================================================================
/* ==========================================================================
   13. Full-Screen Egyptian Gold Market Prices Dashboard & Blur Overlay
   ========================================================================== */

/* Disable background scrolling while gold popup is open */
body.gold-popup-open {
  overflow: hidden !important;
}

/* Semi-transparent dark overlay with strong 16px background blur covering entire viewport */
.gold-popup-overlay {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9998;
  background: rgba(8, 10, 14, 0.88); /* Baseline fallback for unsupported browsers */
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: none;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s ease;
}

.gold-popup-overlay.active {
  display: block !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

/* Fallback background color for browsers that do not support backdrop-filter */
@supports not ((backdrop-filter: blur(16px)) or (-webkit-backdrop-filter: blur(16px))) {
  .gold-popup-overlay {
    background: rgba(8, 10, 14, 0.92) !important;
  }
}

/* Keep the Gold Prices Popup completely sharp and clear, elevated above the overlay */
.gold-popup,
.gold-market-fullscreen {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9999;
  background: radial-gradient(ellipse at 50% 8%, rgba(212, 175, 55, 0.12) 0%, rgba(13, 16, 23, 0.96) 50%, rgba(8, 10, 14, 0.98) 100%);
  color: #f3f4f6;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.35s ease;
  padding: 1.5rem 2rem;
  box-sizing: border-box;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  filter: none !important;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.gold-market-fullscreen.active,
.gold-popup.active {
  display: flex !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
  z-index: 9999 !important;
}

/* Floating quick access button to open market screen anytime */
.floating-gold-pill {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 9990;
  background: rgba(18, 21, 29, 0.95);
  border: 1.5px solid var(--gold-primary, #d4af37);
  color: var(--text-main, #fff);
  padding: 0.6rem 1.1rem;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4), 0 0 15px rgba(212, 175, 55, 0.3);
  backdrop-filter: blur(8px);
  transition: all 0.25s ease;
}

[dir="rtl"] .floating-gold-pill {
  right: auto;
  left: 2rem;
}

.floating-gold-pill:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 6px 25px rgba(212, 175, 55, 0.5);
  background: var(--bg-surface, #14161b);
}

/* Header Area */
.gmd-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.25rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid rgba(212, 175, 55, 0.2);
  margin-bottom: 1.5rem;
}

.gmd-brand-block {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.gmd-logo-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: linear-gradient(135deg, #d4af37, #996515);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  box-shadow: 0 0 20px rgba(212, 175, 55, 0.4);
}

.gmd-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
  margin: 0;
}

[dir="rtl"] .gmd-title {
  font-family: var(--font-arabic);
}

.gmd-title span {
  color: var(--gold-primary, #d4af37);
  background: linear-gradient(135deg, #f7d070, #d4af37, #aa781c);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.gmd-subtitle {
  font-size: 0.85rem;
  color: #9ca3af;
  margin-top: 0.15rem;
}

/* Digital Clock in Cairo Time */
.gmd-clock-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(18, 22, 32, 0.7);
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: 10px;
  padding: 0.5rem 1.25rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.gmd-clock-time {
  font-size: 1.5rem;
  font-weight: 800;
  font-family: 'Courier New', monospace, var(--font-sans);
  color: var(--gold-primary, #d4af37);
  letter-spacing: 0.08em;
  text-shadow: 0 0 10px rgba(212, 175, 55, 0.3);
}

.gmd-clock-date {
  font-size: 0.75rem;
  color: #9ca3af;
  font-weight: 500;
}

/* Status Pill */
.gmd-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.85rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.gmd-status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
}

.gmd-status-pill.live {
  border-color: rgba(16, 185, 129, 0.4);
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
}
.gmd-status-pill.live .gmd-status-dot {
  background: #10b981;
  box-shadow: 0 0 10px #10b981;
  animation: pulse-green 2s infinite;
}

.gmd-status-pill.delayed {
  border-color: rgba(245, 158, 11, 0.4);
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
}
.gmd-status-pill.delayed .gmd-status-dot {
  background: #f59e0b;
}

.gmd-status-pill.offline {
  border-color: rgba(239, 68, 68, 0.4);
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
}
.gmd-status-pill.offline .gmd-status-dot {
  background: #ef4444;
}

@keyframes pulse-green {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

/* Action Controls */
.gmd-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.gmd-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(212, 175, 55, 0.3);
  color: #f3f4f6;
  padding: 0.55rem 1rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
}

.gmd-btn:hover {
  background: rgba(212, 175, 55, 0.15);
  border-color: var(--gold-primary, #d4af37);
  color: #fff;
  transform: translateY(-1px);
}

.gmd-btn-primary {
  background: linear-gradient(135deg, #d4af37, #996515);
  border-color: #d4af37;
  color: #0b0d10;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(212, 175, 55, 0.3);
}

.gmd-btn-primary:hover {
  background: linear-gradient(135deg, #f3cf6a, #d4af37);
  color: #000;
  box-shadow: 0 6px 18px rgba(212, 175, 55, 0.5);
}

/* Quick Indicators Ribbon */
.gmd-ribbon {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.gmd-ribbon-card {
  background: rgba(18, 22, 32, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 0.75rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.gmd-ribbon-label {
  font-size: 0.75rem;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.gmd-ribbon-val {
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
}

/* Karats Grid */
.gmd-karats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

/* Karat Card */
.gmd-card {
  background: linear-gradient(165deg, rgba(22, 28, 42, 0.85) 0%, rgba(13, 16, 24, 0.95) 100%);
  border: 1px solid rgba(212, 175, 55, 0.25);
  border-radius: 14px;
  padding: 1.4rem;
  position: relative;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  display: flex;
  flex-direction: column;
}

.gmd-card:hover {
  transform: translateY(-3px);
  border-color: rgba(212, 175, 55, 0.5);
  box-shadow: 0 12px 30px rgba(212, 175, 55, 0.15);
}

.gmd-card.hero-card {
  border-width: 2px;
  border-color: var(--gold-primary, #d4af37);
  background: linear-gradient(165deg, rgba(30, 36, 52, 0.95) 0%, rgba(15, 19, 28, 0.98) 100%);
  box-shadow: 0 8px 30px rgba(212, 175, 55, 0.22);
}

.gmd-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.gmd-karat-name {
  font-size: 1.4rem;
  font-weight: 800;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.gmd-purity-tag {
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  background: rgba(212, 175, 55, 0.15);
  color: var(--gold-primary, #d4af37);
  font-weight: 700;
}

.gmd-badge-type {
  font-size: 0.7rem;
  padding: 0.25rem 0.55rem;
  border-radius: 6px;
  font-weight: 600;
}

.gmd-badge-verified {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.gmd-badge-indicative {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

/* Prices Side-by-Side */
.gmd-price-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 10px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.gmd-price-box {
  display: flex;
  flex-direction: column;
}

.gmd-price-box.sell {
  border-inline-end: 1px solid rgba(255, 255, 255, 0.08);
  padding-inline-end: 0.75rem;
}

.gmd-price-label {
  font-size: 0.75rem;
  color: #9ca3af;
  margin-bottom: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.gmd-price-num {
  font-size: 1.7rem;
  font-weight: 800;
  line-height: 1.1;
  color: #fff;
  font-family: var(--font-sans);
}

.gmd-price-box.sell .gmd-price-num {
  color: var(--gold-primary, #d4af37);
  text-shadow: 0 0 12px rgba(212, 175, 55, 0.2);
}

.gmd-price-box.buy .gmd-price-num {
  color: #34d399;
}

.gmd-price-unit {
  font-size: 0.8rem;
  font-weight: 500;
  color: #9ca3af;
  margin-inline-start: 0.25rem;
}

/* Movement and Spread Row */
.gmd-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.78rem;
  color: #9ca3af;
}

.gmd-movement-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
}

.gmd-movement-badge.up {
  color: #10b981;
  background: rgba(16, 185, 129, 0.12);
}

.gmd-movement-badge.down {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.12);
}

.gmd-movement-badge.flat {
  color: #9ca3af;
  background: rgba(255, 255, 255, 0.06);
}

.gmd-spread-text {
  font-weight: 600;
  color: #d1d5db;
}

.gmd-card-footer {
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px dashed rgba(255, 255, 255, 0.08);
  font-size: 0.72rem;
  color: #6b7280;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Flash Animations on Price Change */
@keyframes flash-gold-glow {
  0% { box-shadow: 0 0 0px rgba(212, 175, 55, 0); }
  50% { box-shadow: 0 0 30px rgba(212, 175, 55, 0.8), inset 0 0 20px rgba(212, 175, 55, 0.2); }
  100% { box-shadow: 0 0 0px rgba(212, 175, 55, 0); }
}

.gmd-card.price-flash {
  animation: flash-gold-glow 1.5s ease-out;
}

/* Dealers Table Section */
.gmd-dealers-section {
  background: rgba(15, 19, 28, 0.7);
  border: 1px solid rgba(212, 175, 55, 0.2);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 2rem;
}

.gmd-section-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.gmd-dealers-table {
  width: 100%;
  border-collapse: collapse;
}

.gmd-dealers-table th {
  text-align: start;
  font-size: 0.75rem;
  color: #9ca3af;
  text-transform: uppercase;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.gmd-dealers-table td {
  padding: 0.75rem;
  font-size: 0.85rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* Footer & Attribution */
.gmd-footer {
  margin-top: auto;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(212, 175, 55, 0.2);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.75rem;
  color: #9ca3af;
}

.gmd-attribution a {
  color: var(--gold-primary, #d4af37);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.2s;
}

.gmd-attribution a:hover {
  color: #fff;
}

.gmd-timestamps {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

/* Top Live Screen Bar in Main App Header */
.btn-live-market-screen {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.2), rgba(153, 101, 21, 0.3));
  border: 1px solid var(--gold-primary, #d4af37);
  color: var(--gold-primary, #d4af37);
  font-weight: 700;
  padding: 0.45rem 0.85rem;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
  transition: all 0.25s ease;
  font-size: 0.8rem;
  animation: pulse-border 3s infinite;
}

.btn-live-market-screen:hover {
  background: linear-gradient(135deg, #d4af37, #996515);
  color: #000;
  box-shadow: 0 0 15px rgba(212, 175, 55, 0.5);
  transform: translateY(-1px);
}

@keyframes pulse-border {
  0% { box-shadow: 0 0 0 0 rgba(212, 175, 55, 0.4); }
  70% { box-shadow: 0 0 0 6px rgba(212, 175, 55, 0); }
  100% { box-shadow: 0 0 0 0 rgba(212, 175, 55, 0); }
}

@media (max-width: 768px) {
  .gold-market-fullscreen {
    padding: 1rem;
  }
  .gmd-karats-grid {
    grid-template-columns: 1fr;
  }
  .gmd-header {
    flex-direction: column;
    align-items: stretch;
  }
  .gmd-actions {
    justify-content: flex-end;
  }
}

/* ==========================================================================
   Admin Executive Command Center Styling
   ========================================================================== */
.admin-modules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(460px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.admin-feature-card {
  border: 1px solid rgba(212, 175, 55, 0.2);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  background: var(--bg-surface, #14161b);
}

.admin-feature-card:hover {
  border-color: rgba(212, 175, 55, 0.45);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}

.badge-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  font-weight: 600;
  background: var(--bg-surface-subtle, #1a1e27);
  border: 1px solid var(--border-subtle, #272d3b);
  color: var(--text-muted, #94a3b8);
}

.badge-status-pill.live {
  border-color: rgba(212, 175, 55, 0.4);
  color: var(--gold-primary, #d4af37);
  background: rgba(212, 175, 55, 0.08);
}

.badge-status-pill.ready {
  border-color: rgba(16, 185, 129, 0.4);
  color: var(--emerald-live, #10b981);
  background: rgba(16, 185, 129, 0.08);
}

.admin-rate-pill {
  background: var(--bg-surface, #14161b);
  border: 1px solid var(--border-subtle, #272d3b);
  border-radius: var(--radius-sm, 6px);
  padding: 0.5rem 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  transition: all 0.2s ease;
}

.admin-rate-pill:hover {
  border-color: var(--gold-primary, #d4af37);
  transform: translateY(-1px);
}

.admin-rate-pill.highlight {
  border-color: rgba(212, 175, 55, 0.5);
  background: rgba(212, 175, 55, 0.06);
}

.admin-rate-pill .rate-purity {
  font-size: 0.68rem;
  color: var(--text-muted, #94a3b8);
  font-weight: 600;
}

.admin-rate-pill .rate-val {
  font-size: 0.92rem;
  color: var(--text-main, #fff);
  font-weight: 700;
}

.admin-rate-pill.highlight .rate-val {
  color: var(--gold-primary, #d4af37);
}

/* Audit Reconciliation Card */
.audit-reconciliation-card {
  display: flex;
  background: var(--bg-surface-subtle, #1a1e27);
  border: 1px solid var(--border-subtle, #272d3b);
  border-radius: var(--radius-sm, 6px);
  padding: 1.25rem;
  gap: 1.5rem;
  justify-content: space-around;
  flex-wrap: wrap;
}

.audit-col {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
  min-width: 120px;
}

.audit-col.divider {
  border-left: 1px solid var(--border-subtle, #272d3b);
  border-right: 1px solid var(--border-subtle, #272d3b);
  padding: 0 1.25rem;
}

[dir="rtl"] .audit-col.divider {
  border-left: 1px solid var(--border-subtle, #272d3b);
  border-right: 1px solid var(--border-subtle, #272d3b);
}

.audit-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  color: var(--text-muted, #94a3b8);
  font-weight: 600;
  letter-spacing: 0.04em;
}

.audit-val {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-main, #fff);
}

.audit-sub {
  font-size: 0.7rem;
  color: var(--text-muted, #94a3b8);
}

/* Audit Progress Animation */
.admin-progress-bar {
  width: 100%;
  height: 8px;
  background: var(--bg-surface-subtle, #1a1e27);
  border-radius: 9999px;
  overflow: hidden;
  border: 1px solid var(--border-subtle, #272d3b);
}

.admin-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #d4af37, #10b981);
  transition: width 0.15s ease;
  border-radius: 9999px;
}

/* Master Credentials Card */
.admin-creds-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.admin-cred-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-surface-subtle, #1a1e27);
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm, 6px);
  border: 1px solid var(--border-subtle, #272d3b);
  flex-wrap: wrap;
  gap: 0.75rem;
}

.cred-info {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.cred-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
}

.cred-fields {
  display: flex;
  gap: 1.25rem;
  align-items: center;
  flex-wrap: wrap;
  font-size: 0.8rem;
}

.cred-label {
  color: var(--text-muted, #94a3b8);
  font-size: 0.72rem;
  margin-right: 0.25rem;
}

[dir="rtl"] .cred-label {
  margin-right: 0;
  margin-left: 0.25rem;
}

.cred-code {
  background: rgba(0, 0, 0, 0.4);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-family: monospace;
  color: var(--gold-primary, #d4af37);
  border: 1px solid var(--border-subtle, #272d3b);
}

.cred-pass-input {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-subtle, #272d3b);
  border-radius: 4px;
  padding: 0.15rem 0.45rem;
  font-family: monospace;
  color: var(--text-main, #fff);
  font-size: 0.8rem;
  width: 120px;
}

.btn-icon-sm {
  background: none;
  border: 1px solid var(--border-subtle, #272d3b);
  color: var(--text-muted, #94a3b8);
  border-radius: 4px;
  padding: 0.15rem 0.35rem;
  cursor: pointer;
  font-size: 0.75rem;
  transition: all 0.2s;
}

.btn-icon-sm:hover {
  color: var(--gold-primary, #d4af37);
  border-color: var(--gold-primary, #d4af37);
}

/* Badges */
.badge-gold {
  background: rgba(212, 175, 55, 0.15);
  color: var(--gold-primary, #d4af37);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}

.badge-emerald {
  background: rgba(16, 185, 129, 0.15);
  color: var(--emerald-live, #10b981);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}

.badge-blue {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}

@media (max-width: 900px) {
  .admin-modules-grid {
    grid-template-columns: 1fr;
  }
  .audit-col.divider {
    border-left: none;
    border-right: none;
    border-top: 1px solid var(--border-subtle, #272d3b);
    border-bottom: 1px solid var(--border-subtle, #272d3b);
    padding: 0.75rem 0;
  }
}

/* ==========================================================================
   14. Complete Admin Control Center Modules & Tab Navigation
   ========================================================================== */
.admin-tab-nav {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  scrollbar-width: thin;
}

.admin-tab-btn {
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 0.55rem 1rem;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all var(--transition-fast);
}

.admin-tab-btn:hover {
  color: var(--text-main);
  border-color: var(--border-gold);
  background: rgba(212, 175, 55, 0.08);
}

.admin-tab-btn.active {
  background: var(--gold-gradient);
  color: #0b0d12;
  border-color: var(--gold-primary);
  font-weight: 800;
  box-shadow: 0 4px 15px rgba(212, 175, 55, 0.25);
}

.admin-tab-panel {
  display: none;
}

.admin-tab-panel.active {
  display: block;
  animation: fadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* License Certificate Card */
.license-cert-box {
  background: radial-gradient(ellipse at 50% 0%, rgba(212, 175, 55, 0.12) 0%, rgba(18, 22, 31, 0.98) 60%);
  border: 1.5px solid var(--gold-primary);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), inset 0 0 25px rgba(212, 175, 55, 0.1);
  position: relative;
  overflow: hidden;
}

.license-cert-watermark {
  position: absolute;
  right: -20px;
  bottom: -30px;
  font-size: 8rem;
  opacity: 0.04;
  color: var(--gold-primary);
  pointer-events: none;
}

/* Feature Tag Badges */
.feature-pill-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: rgba(212, 175, 55, 0.1);
  border: 1px solid rgba(212, 175, 55, 0.3);
  color: var(--gold-primary);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
}

/* Permission Matrix Table */
.perm-matrix-table td {
  padding: 0.75rem;
  vertical-align: middle;
}

.perm-checkbox-custom {
  accent-color: var(--gold-primary);
  width: 17px;
  height: 17px;
  cursor: pointer;
}

/* Confirmation Dialog */
.confirm-box {
  background: #141821;
  border: 1.5px solid rgba(239, 68, 68, 0.5);
  border-radius: var(--radius-md);
  max-width: 480px;
  width: 100%;
  padding: 1.75rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.7);
}

.badge-red {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}

/* ==========================================================================
   14. Empty States & Dashboard Quick Actions
   ========================================================================== */
.empty-state-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2.25rem 1.25rem;
  background: var(--bg-surface-subtle);
  border: 1px dashed var(--border-card);
  border-radius: var(--radius-md);
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 2.4rem;
  margin-bottom: 0.65rem;
  color: var(--gold-primary);
  opacity: 0.85;
}

.empty-state-title {
  font-weight: 700;
  font-size: 0.98rem;
  color: var(--text-main);
  margin-bottom: 0.35rem;
}

.empty-state-desc {
  font-size: 0.82rem;
  max-width: 400px;
  margin-bottom: 1rem;
  line-height: 1.45;
  color: var(--text-secondary);
}

.dashboard-quick-actions {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
  padding: 0.75rem 1rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  align-items: center;
}

.dashboard-quick-actions-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--gold-primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-right: 0.5rem;
}

[dir="rtl"] .dashboard-quick-actions-title {
  margin-right: 0;
  margin-left: 0.5rem;
}

.quick-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.5rem 0.95rem;
  background: var(--bg-surface-elevated, #161a22);
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
  border-radius: var(--radius-sm, 6px);
  color: var(--text-main, #f3f4f6);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
}

.quick-action-btn .qa-icon-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  transition: all 0.2s ease;
}

.quick-action-btn svg {
  flex-shrink: 0;
  stroke: currentColor;
  transition: transform 0.2s ease;
}

.quick-action-btn:hover {
  background: rgba(28, 33, 44, 0.95);
  border-color: rgba(212, 175, 55, 0.45);
  color: var(--gold-primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

.quick-action-btn:hover .qa-icon-wrap {
  background: rgba(212, 175, 55, 0.15);
  color: var(--gold-primary);
}

.quick-action-btn:hover svg {
  transform: scale(1.1);
}

.quick-action-btn.primary {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.18) 0%, rgba(212, 175, 55, 0.06) 100%);
  border-color: rgba(212, 175, 55, 0.55);
  color: var(--gold-primary);
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(212, 175, 55, 0.12);
}

.quick-action-btn.primary .qa-icon-wrap {
  background: rgba(212, 175, 55, 0.2);
  color: var(--gold-primary);
}

.quick-action-btn.primary:hover {
  background: var(--gold-gradient);
  color: #0c0e12;
  border-color: var(--gold-primary);
  box-shadow: 0 6px 18px rgba(212, 175, 55, 0.4);
}

.quick-action-btn.primary:hover .qa-icon-wrap {
  background: rgba(0, 0, 0, 0.18);
  color: #0c0e12;
}

/* Setup Wizard Steps */
.wizard-step-indicator {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-subtle);
  gap: 0.5rem;
}

.wizard-step-pill {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.wizard-step-pill.active {
  color: var(--gold-primary);
  font-weight: 700;
}

.wizard-step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
}

.wizard-step-pill.active .wizard-step-num {
  background: var(--gold-gradient);
  color: #0c0e12;
  font-weight: 800;
  border-color: var(--gold-primary);
}

/* ==========================================================================
   Developer Attribution & Application Global Footer
   ========================================================================== */
.app-global-footer {
  margin-top: auto;
  padding: 2.5rem 2rem 3rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, transparent 0%, rgba(12, 14, 18, 0.7) 100%);
  width: 100%;
  flex-shrink: 0;
  box-sizing: border-box;
}

.developer-card {
  display: inline-flex;
  align-items: center;
  gap: 1.25rem;
  padding: 0.85rem 1.4rem;
  border-radius: 9999px;
  background: rgba(18, 22, 28, 0.82);
  border: 1px solid rgba(212, 175, 55, 0.32);
  box-shadow: 0 8px 24px -6px rgba(0, 0, 0, 0.5), 0 0 16px -2px rgba(212, 175, 55, 0.14);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  flex-wrap: wrap;
  justify-content: center;
}

.developer-card:hover {
  border-color: rgba(212, 175, 55, 0.65);
  box-shadow: 0 12px 32px -4px rgba(0, 0, 0, 0.65), 0 0 24px 2px rgba(212, 175, 55, 0.28);
  transform: translateY(-2px);
}

.developer-identity {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.developer-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--gold-gradient);
  color: #0c0e12;
  font-weight: 800;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.05em;
  box-shadow: 0 0 12px rgba(212, 175, 55, 0.4);
  flex-shrink: 0;
}

.developer-details {
  display: flex;
  flex-direction: column;
  text-align: left;
}

[dir="rtl"] .developer-details {
  text-align: right;
}

.developer-role {
  font-size: 0.68rem;
  color: var(--gold-primary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}

.developer-name {
  font-size: 0.98rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

.dev-divider {
  width: 1px;
  height: 28px;
  background: rgba(255, 255, 255, 0.14);
}

.dev-social-links {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.dev-social-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.42rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
  color: #e2e8f0;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: all 0.25s ease;
}

.dev-social-btn svg {
  flex-shrink: 0;
  transition: transform 0.25s ease;
}

.dev-social-btn:hover svg {
  transform: scale(1.15);
}

.dev-social-btn.portfolio-btn:hover {
  background: rgba(56, 189, 248, 0.15);
  border-color: rgba(56, 189, 248, 0.5);
  color: #38bdf8;
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.35);
}

.dev-social-btn.insta-btn:hover {
  background: rgba(244, 114, 182, 0.15);
  border-color: rgba(244, 114, 182, 0.5);
  color: #f472b6;
  box-shadow: 0 0 14px rgba(244, 114, 182, 0.35);
}

.dev-social-btn.linkedin-btn:hover {
  background: rgba(14, 165, 233, 0.15);
  border-color: rgba(14, 165, 233, 0.5);
  color: #38bdf8;
  box-shadow: 0 0 14px rgba(14, 165, 233, 0.35);
}

.footer-meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: center;
}

.footer-submeta {
  font-size: 0.7rem;
  color: rgba(160, 174, 192, 0.65);
  letter-spacing: 0.04em;
}

@media (max-width: 768px) {
  .app-global-footer {
    padding-bottom: 5.5rem; /* Space for mobile taskbar */
  }
  .developer-card {
    border-radius: 16px;
    flex-direction: column;
    padding: 1rem;
    width: 100%;
    max-width: 360px;
  }
  .dev-divider {
    width: 100%;
    height: 1px;
  }
}




