/**
 * AS-PRO Glass Workspace Preview (DM-018)
 * Прозрачное стекло + проекция HUD на лобовом стекле
 */

:root {
  --charcoal: #060a0e;
  /* Планшет: почти чистое стекло — фон просвечивает */
  --glass-clear: rgba(255, 255, 255, 0.012);
  --glass-clear-hover: rgba(255, 255, 255, 0.028);
  /* Пустая карточка: лобовое стекло, только рамка */
  --glass-empty: rgba(255, 255, 255, 0.006);
  --glass-pane: rgba(255, 255, 255, 0.04);
  --glass-pane-filled: rgba(8, 14, 22, 0.38);
  --glass-border: rgba(94, 234, 212, 0.38);
  --glass-border-soft: rgba(255, 255, 255, 0.14);
  --glass-rim-cyan: rgba(56, 189, 248, 0.5);
  --glass-rim-glow: rgba(56, 189, 248, 0.22);
  --glass-highlight: rgba(255, 255, 255, 0.45);
  --blur-stage: 10px;
  --blur-pane: 6px;
  --blur-empty: 4px;
  --text-primary: #f0f6fc;
  --text-muted: #8ba3b8;
  --accent-cyan: #5eead4;
  --accent-sky: #38bdf8;
  --accent-amber: #fcd34d;
  --accent-emerald: #6ee7b7;
  --accent-violet: #c4b5fd;
  --radius-stage: 24px;
  --radius-pane: 16px;
  --font: "Inter", system-ui, sans-serif;
  --stage-inset: clamp(10px, 1.5vw, 22px);
  --proj-glow: 0 0 6px rgba(94, 234, 212, 0.9), 0 0 18px rgba(56, 189, 248, 0.55), 0 0 36px rgba(56, 189, 248, 0.25);
}

[data-workspace-theme="light"],
[data-theme="light"] {
  --charcoal: #f1f5f9;
  --glass-clear: #ffffff;
  --glass-clear-hover: #f8fafc;
  --glass-empty: #ffffff;
  --glass-pane: #ffffff;
  --glass-pane-filled: #ffffff;
  --glass-border: #e2e8f0;
  --glass-border-soft: #cbd5e1;
  --glass-rim-cyan: #93c5fd;
  --glass-rim-glow: rgba(37, 99, 235, 0.12);
  --glass-highlight: #f8fafc;
  --text-primary: #0f172a;
  --text-muted: #475569;
  --accent-cyan: #0369a1;
  --accent-sky: #2563eb;
  --proj-glow: none;
}

*, *::before, *::after { box-sizing: border-box; }

html { font-size: 15px; }

body.aspro-glass-ws {
  margin: 0;
  font-family: var(--font);
  color: var(--text-primary);
  background: var(--charcoal);
  line-height: 1.45;
  overflow: hidden;
  height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-sky); text-decoration: none; }

.preview-ribbon,
.aspro-glass-ws .preview-ribbon {
  display: none !important;
}

.preview-ribbon--unused {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 9999;
  padding: 0.3rem 1rem;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: center;
  color: #041018;
  background: linear-gradient(90deg, #5eead4, #38bdf8);
  pointer-events: none;
}

/* Ambient: glass-ambient.css */

/* --- Chrome (вне стекла) --- */
.chrome-header {
  position: relative;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 2.35rem var(--stage-inset) 0.5rem;
  max-width: 1680px;
  margin: 0 auto;
}

.chrome-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: inherit;
  text-decoration: none;
}

.chrome-brand img {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--glass-border-soft);
}

.chrome-brand strong { display: block; font-size: 0.85rem; }
.chrome-brand span { display: block; font-size: 0.65rem; color: var(--text-muted); }

.chrome-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
}

.chrome-actions a {
  color: var(--text-muted);
  padding: 0.4rem 0.75rem;
}

.chrome-actions a.is-active {
  color: var(--accent-cyan);
  text-shadow: var(--proj-glow);
}

.btn-account {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--glass-border-soft);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  text-decoration: none;
  font-size: 0.8rem;
}

/* --- Glass shell --- */
.glass-app {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  height: calc(100vh - 4.5rem);
  max-width: 1680px;
  margin: 0 auto;
  padding: 0 var(--stage-inset) var(--stage-inset);
}

.glass-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-stage);
  background: var(--glass-clear);
  backdrop-filter: blur(var(--blur-stage)) saturate(165%) brightness(1.05);
  -webkit-backdrop-filter: blur(var(--blur-stage)) saturate(165%) brightness(1.05);
  border: 1px solid rgba(94, 234, 212, 0.32);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.08) inset,
    inset 0 1px 0 var(--glass-highlight),
    0 0 40px var(--glass-rim-glow),
    0 0 100px rgba(56, 189, 248, 0.08);
  overflow: hidden;
}

/* Блик лобового стекла */
.glass-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 5;
  background:
    linear-gradient(125deg, rgba(255, 255, 255, 0.14) 0%, transparent 28%),
    linear-gradient(305deg, rgba(255, 255, 255, 0.04) 0%, transparent 22%);
  opacity: 0.7;
}

.glass-stage__rim {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 6;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.glass-stage__rim::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(
    140deg,
    rgba(255, 255, 255, 0.65),
    rgba(94, 234, 212, 0.35) 30%,
    transparent 50%,
    transparent 70%,
    rgba(56, 189, 248, 0.4) 100%
  );
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}

/* --- Проекция на лобовом стекле --- */
/* Чёткий HUD-текст: контраст + лёгкое свечение (не размытый bloom) */
.projection,
.projection h1,
.projection h2,
.projection h3,
.projection .projection__strong {
  color: #f1f5f9;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-shadow:
    0 1px 0 rgba(0, 0, 0, 0.85),
    0 2px 8px rgba(0, 0, 0, 0.65),
    0 0 1px rgba(255, 255, 255, 0.95),
    0 0 12px rgba(56, 189, 248, 0.22);
  -webkit-font-smoothing: antialiased;
}

.projection--soft {
  color: #e2e8f0;
  font-weight: 600;
  text-shadow:
    0 1px 0 rgba(0, 0, 0, 0.8),
    0 2px 6px rgba(0, 0, 0, 0.55),
    0 0 8px rgba(56, 189, 248, 0.15);
}

.projection--amber {
  color: #fde68a;
  font-weight: 700;
  text-shadow:
    0 1px 0 rgba(0, 0, 0, 0.85),
    0 2px 8px rgba(0, 0, 0, 0.6),
    0 0 10px rgba(251, 191, 36, 0.25);
}

.projection--dim {
  color: #cbd5e1;
  font-weight: 450;
  text-shadow:
    0 1px 2px rgba(0, 0, 0, 0.75),
    0 0 1px rgba(0, 0, 0, 0.5);
}

/* --- Rail внутри стекла (разделы) --- */
.glass-rail {
  position: relative;
  z-index: 8;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(94, 234, 212, 0.2);
  background: rgba(255, 255, 255, 0.008);
  backdrop-filter: blur(4px);
}

.glass-rail__btn {
  flex: 1 1 120px;
  min-width: 0;
  padding: 0.55rem 0.75rem;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.75rem;
  text-align: left;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.glass-rail__btn strong {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 0.1rem;
}

.glass-rail__btn span {
  display: block;
  font-size: 0.65rem;
  opacity: 0.75;
  line-height: 1.3;
}

.glass-rail__btn:hover {
  background: var(--glass-clear-hover);
  border-color: var(--glass-border-soft);
}

.glass-rail__btn.is-active {
  background: rgba(56, 189, 248, 0.08);
  border-color: rgba(56, 189, 248, 0.35);
  color: var(--text-primary);
}

.glass-rail__btn.is-active strong {
  color: rgba(235, 250, 255, 0.98);
  text-shadow: 0 0 8px rgba(56, 189, 248, 0.6);
}

/* --- Контент стекла --- */
.glass-body {
  position: relative;
  z-index: 7;
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 1rem 1.15rem 1.25rem;
}

.glass-body::-webkit-scrollbar { width: 5px; }
.glass-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 3px;
}

.glass-scene { display: none; }
.glass-scene.is-active { display: block; }

/* --- Внутренние панели (ещё прозрачнее) --- */
.glass-pane {
  position: relative;
  border-radius: var(--radius-pane);
  background: var(--glass-pane);
  backdrop-filter: blur(var(--blur-pane)) saturate(160%);
  -webkit-backdrop-filter: blur(var(--blur-pane)) saturate(160%);
  border: 1px solid var(--glass-border-soft);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
  padding: 1rem 1.1rem;
  margin-bottom: 0.85rem;
}

/* Пустое стекло — лобовое HUD: рамка светится, внутри просвечивает фон */
.glass-pane--empty {
  background: var(--glass-empty);
  backdrop-filter: blur(var(--blur-empty)) saturate(140%);
  -webkit-backdrop-filter: blur(var(--blur-empty)) saturate(140%);
  border: 1px solid rgba(94, 234, 212, 0.45);
  box-shadow:
    0 0 12px rgba(56, 189, 248, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  min-height: 140px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1.35rem 1.1rem;
  gap: 0.35rem;
}

.glass-pane--empty .empty-slot__icon {
  font-size: 1.35rem;
  color: rgba(148, 210, 230, 0.55);
  margin-bottom: 0.25rem;
  text-shadow: 0 0 10px rgba(56, 189, 248, 0.2);
}

.glass-pane--empty .projection--soft {
  font-size: 0.88rem;
}

.glass-pane--empty .projection--dim {
  font-size: 0.74rem;
  max-width: 16rem;
}

.glass-pane--empty:hover {
  border-color: rgba(94, 234, 212, 0.75);
  box-shadow:
    0 0 28px rgba(56, 189, 248, 0.2),
    inset 0 0 32px rgba(56, 189, 248, 0.06);
}

.glass-pane--filled {
  background: var(--glass-pane-filled);
  backdrop-filter: blur(14px);
  border-color: rgba(255, 255, 255, 0.16);
}

.glass-pane--dense {
  background: rgba(8, 14, 22, 0.52);
  backdrop-filter: blur(12px);
}

/* --- Projects list --- */
.stats-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.stat-pill {
  font-size: 0.72rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--glass-border-soft);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
}

.stat-pill strong {
  color: var(--accent-cyan);
  text-shadow: 0 0 8px rgba(94, 234, 212, 0.5);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.btn-glow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  font-size: 0.8rem;
  font-weight: 600;
  font-family: inherit;
  color: #041018;
  background: linear-gradient(135deg, #a7f3d0, #38bdf8);
  border: none;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.35);
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.75rem;
}

.project-card {
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s;
}

.project-card:hover {
  transform: translateY(-2px);
  border-color: rgba(56, 189, 248, 0.35);
}

.project-card__meta {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

/* --- Tender detail --- */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  margin-bottom: 0.75rem;
  padding: 0;
}

.path-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.7rem;
  padding: 0.45rem 0.65rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border-soft);
  margin-bottom: 0.75rem;
}

.path-bar__step { color: var(--text-muted); }
.path-bar__step.is-current {
  color: var(--accent-sky);
  text-shadow: 0 0 8px rgba(56, 189, 248, 0.5);
  font-weight: 600;
}
.path-bar__sep { opacity: 0.35; }

.vitrine-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}

@media (max-width: 800px) {
  .vitrine-row { grid-template-columns: 1fr; }
}

.vitrine-btn {
  padding: 0.65rem 0.75rem;
  border-radius: 12px;
  border: 1px solid var(--glass-border-soft);
  background: rgba(255, 255, 255, 0.02);
  color: inherit;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.vitrine-btn strong {
  display: block;
  font-size: 0.78rem;
  margin-bottom: 0.15rem;
}

.vitrine-btn span {
  font-size: 0.65rem;
  color: var(--text-muted);
}

.vitrine-btn:hover,
.vitrine-btn.is-active {
  border-color: rgba(56, 189, 248, 0.4);
  background: rgba(56, 189, 248, 0.06);
}

.tender-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.85rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--glass-border-soft);
}

.tender-tabs__group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
}

.tender-tabs__label {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-right: 0.25rem;
  opacity: 0.7;
}

/* Вкладки — лобовое стекло HUD */
.tab-btn {
  padding: 0.35rem 0.65rem;
  font-size: 0.72rem;
  font-family: inherit;
  border-radius: 8px;
  border: 1px solid rgba(94, 234, 212, 0.22);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-muted);
  cursor: pointer;
}

.tab-btn:hover {
  border-color: rgba(94, 234, 212, 0.4);
  background: rgba(255, 255, 255, 0.04);
}

.tab-btn.is-active {
  border-color: rgba(94, 234, 212, 0.65);
  background: rgba(56, 189, 248, 0.06);
  color: var(--text-primary);
  text-shadow: 0 0 8px rgba(56, 189, 248, 0.55);
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.12), inset 0 0 10px rgba(56, 189, 248, 0.04);
}

.tab-panel { display: none; }
.tab-panel.is-active { display: block; }

.l0-card {
  border-left: 3px solid var(--accent-sky);
  padding-left: 0.85rem;
  margin-bottom: 0.75rem;
}

.l0-card p {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.5;
}

.l0-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.7rem;
  margin-top: 0.65rem;
  color: var(--text-muted);
}

.next-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--glass-border-soft);
}

/* --- Table (плотная зона для цифр) --- */
.data-table-wrap {
  overflow: auto;
  border-radius: 10px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.75rem;
}

.data-table th,
.data-table td {
  padding: 0.45rem 0.55rem;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.data-table th {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-weight: 600;
}

.data-table td.num {
  font-variant-numeric: tabular-nums;
  color: var(--accent-emerald);
  text-shadow: 0 0 6px rgba(110, 231, 183, 0.35);
}

/* --- Account --- */
.account-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
}

.account-tile h3 {
  margin: 0 0 0.35rem;
  font-size: 0.85rem;
}

.account-tile p {
  margin: 0;
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* --- Scene picker footer --- */
.preview-hint {
  position: fixed;
  bottom: 0.5rem;
  right: 0.75rem;
  z-index: 40;
  font-size: 0.65rem;
  color: var(--text-muted);
  opacity: 0.7;
}

@media (max-width: 700px) {
  .glass-rail__btn span { display: none; }
  .chrome-actions a:not(.btn-account) { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .project-card { transition: none; }
}
