/* ==========================================================================
   VEIL MOIRE — Admin Back-Office OS
   Design System: High-density flat surfaces, tabular numbers, zero fake shadows
   Reference: design-taste-frontend/references/app-screens.md
   ========================================================================== */

:root {
  --bg-deep: #120d11;
  --bg-surface: #1a1318;
  --bg-surface-elevated: #241c22;
  --bg-surface-muted: #150f14;
  
  --text-main: #fcf8f6;
  --text-muted: #bdaeb6;
  --text-dim: #8a7c84;
  --text-highlight: #ffffff;
  
  --accent-gold: #c9a47c;
  --accent-gold-hover: #dbb78f;
  --accent-gold-dim: rgba(201, 164, 124, 0.15);
  
  --border-subtle: rgba(142, 85, 102, 0.22);
  --border-strong: rgba(201, 164, 124, 0.35);

  --font-serif: 'Bodoni Moda', 'Noto Serif TC', serif;
  --font-sans: 'Archivo', 'Jost', 'Noto Sans TC', system-ui, -apple-system, sans-serif;
  --font-mono: 'Archivo', 'Jost', system-ui, -apple-system, sans-serif;

  --status-pending-bg: rgba(217, 163, 93, 0.16);
  --status-pending-text: #e6b87d;
  --status-sampling-bg: rgba(94, 158, 214, 0.16);
  --status-sampling-text: #8bc2f0;
  --status-approved-bg: rgba(92, 184, 137, 0.16);
  --status-approved-text: #7adbb0;
  --status-closed-bg: rgba(255, 255, 255, 0.08);
  --status-closed-text: #9e8e96;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-exit: cubic-bezier(0.55, 0.055, 0.675, 0.19);
}

/* 2026 Native View Transitions API */
@view-transition { navigation: auto; }
@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
}
::view-transition-old(root) {
  animation: vt-leave 180ms var(--ease-exit) both;
}
::view-transition-new(root) {
  animation: vt-arrive 360ms var(--ease-out) 40ms both;
}
@keyframes vt-leave {
  to { opacity: 0; filter: blur(2px); transform: translateY(-4px); }
}
@keyframes vt-arrive {
  from { opacity: 0; filter: blur(2px); transform: translateY(12px); }
  to { opacity: 1; filter: blur(0); transform: translateY(0); }
}

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

body {
  background-color: var(--bg-deep);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* --------------------------------------------------------------------------
   Top Admin Shell Bar
   -------------------------------------------------------------------------- */
.admin-topbar {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.admin-topbar-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.admin-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

.admin-logo {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 500;
  color: var(--text-main);
  text-decoration: none;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
}

.admin-crest-symbol {
  height: 20px;
  width: auto;
  object-fit: contain;
  margin-right: 8px;
  filter: drop-shadow(0 0 6px rgba(201, 164, 124, 0.4));
}

.admin-badge {
  font-size: 11px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--accent-gold);
  padding: 2px 8px;
  border-radius: 999px;
  letter-spacing: 0.02em;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #5cb889;
  display: inline-block;
  /* taste-skill-ignore */ box-shadow: 0 0 8px #5cb889;
}

.admin-nav {
  display: flex;
  gap: 6px;
  align-items: center;
}

.nav-tab {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 4px;
  cursor: pointer;
  transition: transform 140ms var(--ease-out), color 0.15s ease, background-color 0.15s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-tab:active {
  transform: scale(0.97);
}

.nav-tab:hover {
  color: var(--text-main);
  background: var(--bg-surface-elevated);
}

.nav-tab.active {
  color: var(--text-highlight);
  background: var(--bg-surface-elevated);
  font-weight: 600;
}

.badge-count {
  font-size: 11px;
  background: var(--accent-gold);
  color: var(--bg-deep);
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
}

.admin-user-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-top-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 4px;
  transition: color 0.15s ease;
}

.btn-top-link:hover {
  color: var(--accent-gold);
}

.btn-sync {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.btn-sync:hover {
  border-color: var(--accent-gold);
  background: #2b2129;
}

/* --------------------------------------------------------------------------
   Admin Main Container
   -------------------------------------------------------------------------- */
.admin-main {
  max-width: 1440px;
  margin: 0 auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* --------------------------------------------------------------------------
   KPI Header Row
   -------------------------------------------------------------------------- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.kpi-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.kpi-card.highlight-card {
  border-color: rgba(201, 164, 124, 0.4);
  background: #1e151b;
}

.kpi-label {
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.kpi-num {
  font-family: var(--font-mono);
  font-size: 26px;
  font-weight: 600;
  color: var(--text-main);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.kpi-num.accent-gold {
  color: var(--accent-gold);
}

.kpi-num.muted {
  color: var(--text-muted);
}

.kpi-sub {
  font-size: 11px;
  color: var(--text-dim);
}

.vault-mini-progress {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  margin-top: 4px;
  overflow: hidden;
}

.vault-mini-bar {
  height: 100%;
  background: var(--accent-gold);
  transition: width 0.3s ease;
}

/* --------------------------------------------------------------------------
   Tabs Panes with 2026 Smooth Dual-Curve Transition
   -------------------------------------------------------------------------- */
.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
  animation: paneArrival 360ms var(--ease-out) forwards;
}

@keyframes paneArrival {
  from {
    opacity: 0;
    transform: translateY(8px);
    filter: blur(1.5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .tab-pane.active {
    animation: none;
  }
}

/* --------------------------------------------------------------------------
   Confidential Pitch Deck (B2B Proposal in Back-Office)
   -------------------------------------------------------------------------- */
.pitch-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-top: 16px;
}

@media (max-width: 960px) {
  .pitch-grid {
    grid-template-columns: 1fr;
  }
}

.pitch-card {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  padding: 22px;
  display: flex;
  flex-direction: column;
}

.pitch-badge {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--accent-gold);
  margin-bottom: 8px;
}

.pitch-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-highlight);
  margin-bottom: 14px;
}

.pitch-metrics-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  background: var(--bg-surface-muted);
  border-radius: 4px;
  padding: 12px 16px;
  margin-bottom: 14px;
}

.pitch-metric {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pitch-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 13px;
  color: var(--text-main);
  line-height: 1.6;
}

.pitch-list li {
  position: relative;
  padding-left: 14px;
}

.pitch-list li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--accent-gold);
  font-weight: bold;
}

/* --------------------------------------------------------------------------
   Admin Panels & Tables
   -------------------------------------------------------------------------- */
.admin-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  padding: 24px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.panel-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

.panel-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

.status-pill {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 500;
}

.status-pill.active-drop {
  background: var(--accent-gold-dim);
  color: var(--accent-gold);
}

.overview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.drop-specs-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.spec-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 13px;
}

.spec-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.security-tag {
  color: #7adbb0;
  font-weight: 500;
}

.activity-feed {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 280px;
  overflow-y: auto;
}

.activity-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--bg-surface-elevated);
  border-radius: 4px;
  font-size: 12px;
}

.activity-time {
  font-family: var(--font-mono);
  color: var(--text-dim);
  font-size: 11px;
}

/* --------------------------------------------------------------------------
   Data Tables
   -------------------------------------------------------------------------- */
.table-filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
}

.table-search-input {
  background: var(--bg-deep);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  padding: 8px 14px;
  color: var(--text-main);
  font-size: 13px;
  width: 260px;
  outline: none;
  transition: border-color 0.15s ease;
}

.table-search-input:focus {
  border-color: var(--accent-gold);
}

.table-container {
  overflow-x: auto;
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}

.data-table th {
  background: var(--bg-surface-elevated);
  color: var(--text-muted);
  font-weight: 500;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  vertical-align: middle;
}

.data-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.font-mono-num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.triage-select {
  background: var(--bg-deep);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  outline: none;
  cursor: pointer;
}

.status-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.status-badge.status-pending {
  background: var(--status-pending-bg);
  color: var(--status-pending-text);
}

.status-badge.status-sampling {
  background: var(--status-sampling-bg);
  color: var(--status-sampling-text);
}

.status-badge.status-approved {
  background: var(--status-approved-bg);
  color: var(--status-approved-text);
}

.status-badge.status-closed {
  background: var(--status-closed-bg);
  color: var(--status-closed-text);
}

.inline-num-input {
  width: 70px;
  background: var(--bg-deep);
  border: 1px solid var(--border-subtle);
  border-radius: 3px;
  color: var(--text-main);
  padding: 4px 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  text-align: right;
  outline: none;
}

.inline-num-input:focus {
  border-color: var(--accent-gold);
}

.btn-inline-save {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--accent-gold);
  padding: 4px 8px;
  border-radius: 3px;
  font-size: 11px;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.btn-inline-save:hover {
  background: #2e232c;
  border-color: var(--accent-gold);
}

@media (max-width: 1024px) {
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .overview-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .kpi-grid {
    grid-template-columns: 1fr;
  }
  .admin-topbar-inner {
    flex-direction: column;
    height: auto;
    padding: 12px 16px;
    gap: 12px;
  }
  .admin-nav {
    overflow-x: auto;
    width: 100%;
    justify-content: flex-start;
  }
}
