/* ═══════════════════════════════════════════════════
   Mirror-verse — Alexandria Design System

   Vodní hladina jako podlaha celé platformy.
   Nad hladinou — realita. Barvy, chaos, život.
   Pod hladinou — bílý svět. Data, vzory, pravda.
   Hladina samotná — mřížka. Rozhraní. Vibrace.

   Prostředí formuje chování. Chrám → lidé se chovají jako v chrámu.
   ═══════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700&family=Crimson+Text:ital,wght@0,400;0,600;1,400&family=Noto+Color+Emoji&display=swap');

:root {
  --bg-deep:     #0d0b08;
  --bg-dark:     #1a1510;
  --bg-card:     #2a2218;
  --bg-card-hover: #3a3020;
  --bg-input:    #1e1a14;

  --text-primary:   #ece2d0;
  --text-secondary: #b8ac95;
  --text-muted:     #b8a890;

  --gold:        #c9a84c;
  --gold-dim:    #8a7530;
  --gold-glow:   rgba(201, 168, 76, 0.3);
  --gold-faint:  rgba(201, 168, 76, 0.06);

  --green:       #4caf50;
  --orange:      #ff9800;
  --red:         #f44336;
  --blue:        #42a5f5;

  /* Vodní hladina */
  --water-deep:    rgba(15, 25, 40, 0.95);
  --water-surface: rgba(100, 140, 180, 0.08);
  --water-ripple:  rgba(201, 168, 76, 0.04);
  --water-shine:   rgba(180, 200, 220, 0.06);
  --reflection-opacity: 0.35;

  --font-heading: 'Cinzel', serif;
  --font-body:    'Crimson Text', serif;
  --font-mono:    'JetBrains Mono', monospace;

  --radius: 8px;
  --radius-lg: 16px;
  --max-width: 1200px;
}

/* ── Reset ────────────────────────────────────── */

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: var(--bg-deep);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ═══════════════════════════════════════════════════
   VODNÍ HLADINA — Podlaha celé platformy
   Tenká vrstva vody zrcadlící svět nad sebou
   ═══════════════════════════════════════════════════ */

/* Ambient water glow on body */
body::after {
  content: '';
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 40vh;
  background: linear-gradient(
    to top,
    rgba(60, 100, 140, 0.06) 0%,
    rgba(40, 80, 120, 0.03) 30%,
    transparent 100%
  );
  pointer-events: none;
  z-index: 0;
}

/* ── Water surface line ───────────────────────── */

.water-surface {
  position: relative;
  width: 100%;
  height: 2px;
  margin: 0;
  overflow: visible;
}

.water-surface::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(100, 160, 220, 0.15) 15%,
    rgba(201, 168, 76, 0.3) 35%,
    rgba(180, 210, 240, 0.4) 50%,
    rgba(201, 168, 76, 0.3) 65%,
    rgba(100, 160, 220, 0.15) 85%,
    transparent 100%
  );
  animation: water-shimmer 8s ease-in-out infinite;
}

.water-surface::after {
  content: '';
  position: absolute;
  top: 1px;
  left: 0;
  right: 0;
  height: 60px;
  background: linear-gradient(
    to bottom,
    rgba(80, 130, 180, 0.06) 0%,
    rgba(40, 80, 120, 0.02) 40%,
    transparent 100%
  );
  pointer-events: none;
}

@keyframes water-shimmer {
  0%, 100% { opacity: 0.7; }
  25% { opacity: 1; }
  50% { opacity: 0.6; }
  75% { opacity: 0.9; }
}

/* ── Reflection container ─────────────────────── */
/* Wrap content that should have a reflection below the water line */

.reflection-zone {
  position: relative;
}

.reflection-zone::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 80px;
  background: linear-gradient(
    to bottom,
    var(--water-shine) 0%,
    transparent 100%
  );
  mask-image: linear-gradient(to bottom, rgba(0,0,0,0.15) 0%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,0.15) 0%, transparent 100%);
  pointer-events: none;
  transform: scaleY(-1);
  filter: blur(1px);
}

/* ═══════════════════════════════════════════════════
   HERO — Alexandrijská knihovna s vodní podlahou
   ═══════════════════════════════════════════════════ */

.hero {
  position: relative;
  width: 100%;
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* Library background image */
.hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('/images/hero-library.jpg') center top / cover no-repeat;
  filter: brightness(0.4) saturate(0.7);
  z-index: 0;
}

/* Gradient overlay — fading into water */
.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    to bottom,
    rgba(13, 11, 8, 0.3) 0%,
    rgba(13, 11, 8, 0.1) 30%,
    rgba(13, 11, 8, 0.2) 60%,
    rgba(13, 11, 8, 0.85) 85%,
    var(--bg-deep) 100%
  );
  z-index: 1;
}

/* Water reflection of the library — below the hero */
.hero-reflection {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 35%;
  background: url('/images/hero-library.jpg') center bottom / cover no-repeat;
  transform: scaleY(-1);
  filter: brightness(0.15) saturate(0.3) blur(3px);
  opacity: var(--reflection-opacity);
  mask-image: linear-gradient(to top, rgba(0,0,0,0.4) 0%, transparent 80%);
  -webkit-mask-image: linear-gradient(to top, rgba(0,0,0,0.4) 0%, transparent 80%);
  z-index: 0;
}

/* Water ripple overlay on the reflection */
.hero-water {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 35%;
  z-index: 2;
  pointer-events: none;
  background:
    repeating-linear-gradient(
      0deg,
      transparent 0px,
      transparent 3px,
      rgba(100, 160, 220, 0.02) 3px,
      rgba(100, 160, 220, 0.02) 4px
    );
  animation: ripple-drift 12s linear infinite;
}

@keyframes ripple-drift {
  0% { background-position-y: 0; }
  100% { background-position-y: 40px; }
}

/* Hero content */
.hero-content {
  position: relative;
  z-index: 10;
  text-align: center;
  padding: 2rem;
  max-width: 700px;
}

.hero-title {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 6vw, 3.5rem);
  color: var(--gold);
  letter-spacing: 0.15em;
  margin-bottom: 0.5rem;
  text-shadow: 0 0 40px rgba(201, 168, 76, 0.3);
}

.hero-subtitle {
  font-family: var(--font-body);
  font-size: clamp(1rem, 2.5vw, 1.3rem);
  color: var(--text-secondary);
  font-style: italic;
  margin-bottom: 2rem;
  line-height: 1.8;
}

.hero-eta {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: rgba(201, 168, 76, 0.5);
  letter-spacing: 0.2em;
}

/* Water line at the hero bottom */
.hero .water-surface {
  position: absolute;
  bottom: 35%;
  z-index: 5;
}

/* ═══════════════════════════════════════════════════
   GRID / MŘÍŽKA — Informační vrstva pod hladinou
   ═══════════════════════════════════════════════════ */

.grid-section {
  position: relative;
  padding: 3rem 0;
}

/* Subtle grid pattern — the information layer */
.grid-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image:
    linear-gradient(rgba(201, 168, 76, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(201, 168, 76, 0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
  pointer-events: none;
  opacity: 0.5;
  animation: grid-pulse 6s ease-in-out infinite;
}

@keyframes grid-pulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.6; }
}

/* ═══════════════════════════════════════════════════
   LAYOUT
   ═══════════════════════════════════════════════════ */

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
  position: relative;
  z-index: 1;
}

/* ═══════════════════════════════════════════════════
   HEADER
   ═══════════════════════════════════════════════════ */

.header {
  border-bottom: 1px solid rgba(201, 168, 76, 0.15);
  padding: 0.8rem 0;
  background: rgba(13, 11, 8, 0.85);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-family: var(--font-heading);
  font-size: clamp(1rem, 2.5vw, 1.4rem);
  color: var(--gold);
  text-decoration: none;
  letter-spacing: 0.12em;
}

.logo span {
  color: var(--text-muted);
  font-size: 0.65em;
  letter-spacing: 0.05em;
}

.nav {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.nav a {
  color: var(--text-secondary);
  text-decoration: none;
  font-family: var(--font-heading);
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  transition: color 0.3s;
  position: relative;
}

.nav a:hover, .nav a.active {
  color: var(--gold);
}

.nav a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--gold);
  transform: scaleX(0);
  transition: transform 0.3s;
}

.nav a:hover::after, .nav a.active::after {
  transform: scaleX(1);
}

/* ── Auth header ──────────────────────────────── */

.auth-section {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-primary);
  font-size: 0.9rem;
}

.eta-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-family: var(--font-mono);
}

.eta-badge.stable { background: rgba(76, 175, 80, 0.15); color: var(--green); }
.eta-badge.warning { background: rgba(255, 152, 0, 0.15); color: var(--orange); }
.eta-badge.critical { background: rgba(244, 67, 54, 0.15); color: var(--red); }

/* ═══════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.2rem;
  border: 1px solid var(--gold-dim);
  border-radius: var(--radius);
  background: transparent;
  color: var(--gold);
  font-family: var(--font-heading);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: all 0.3s;
  text-decoration: none;
}

.btn:hover {
  background: var(--gold-glow);
  border-color: var(--gold);
  box-shadow: 0 0 15px rgba(201, 168, 76, 0.15);
}

.btn-primary {
  background: var(--gold);
  color: var(--bg-deep);
  border-color: var(--gold);
  font-weight: 600;
}

.btn-primary:hover {
  background: #d4b45c;
  box-shadow: 0 0 20px rgba(201, 168, 76, 0.3);
}

.btn-sm {
  padding: 0.35rem 0.8rem;
  font-size: 0.75rem;
}

.btn-lg {
  padding: 0.8rem 2rem;
  font-size: 0.95rem;
}

/* ═══════════════════════════════════════════════════
   CARDS — floating above the water
   ═══════════════════════════════════════════════════ */

.card {
  background: var(--bg-card);
  border: 1px solid rgba(201, 168, 76, 0.08);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: all 0.4s;
  position: relative;
}

.card::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 10%;
  right: 10%;
  height: 8px;
  background: linear-gradient(
    to bottom,
    rgba(60, 100, 140, 0.08) 0%,
    transparent 100%
  );
  border-radius: 0 0 50% 50%;
  filter: blur(2px);
  transition: opacity 0.4s;
  opacity: 0;
}

.card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(201, 168, 76, 0.2);
  transform: translateY(-2px);
  box-shadow:
    0 4px 20px rgba(0, 0, 0, 0.4),
    0 0 30px rgba(201, 168, 76, 0.05);
}

.card:hover::after {
  opacity: 1;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

/* Desktop override — force multi-column on wide screens */
@media (min-width: 900px) {
  .card-grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  }
}

.card h3 {
  font-family: var(--font-heading);
  color: var(--gold);
  font-size: 1.05rem;
  margin-bottom: 0.5rem;
}

.card p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.card-meta {
  display: flex;
  gap: 1rem;
  margin-top: 0.75rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ═══════════════════════════════════════════════════
   FORMS
   ═══════════════════════════════════════════════════ */

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

.form-group label {
  display: block;
  font-family: var(--font-heading);
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 0.3rem;
  letter-spacing: 0.06em;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.6rem 0.8rem;
  background: var(--bg-input);
  border: 1px solid rgba(201, 168, 76, 0.15);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.95rem;
  transition: all 0.3s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 2px var(--gold-glow), 0 0 15px rgba(201, 168, 76, 0.1);
}

/* ═══════════════════════════════════════════════════
   PERSONA TABS — 3 tváře jedné identity
   ═══════════════════════════════════════════════════ */

.persona-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid rgba(201, 168, 76, 0.15);
  margin-bottom: 1.5rem;
}

.persona-tab {
  padding: 0.75rem 1.5rem;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-secondary);
  font-family: var(--font-heading);
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all 0.3s;
}

.persona-tab.active {
  color: var(--gold);
  border-bottom-color: var(--gold);
}

.persona-tab:hover {
  color: var(--text-primary);
}

/* ═══════════════════════════════════════════════════
   COMMUNITY CARDS
   ═══════════════════════════════════════════════════ */

.community-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.member-count {
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* ═══════════════════════════════════════════════════
   POST FEED
   ═══════════════════════════════════════════════════ */

.post {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid rgba(201, 168, 76, 0.06);
}

.post:last-child { border-bottom: none; }

.post-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.post-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--gold-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  color: var(--gold);
  font-family: var(--font-heading);
}

.post-author {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  color: var(--gold);
}

.post-time {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.post-content {
  color: var(--text-primary);
  line-height: 1.7;
}

/* ═══════════════════════════════════════════════════
   PAGES
   ═══════════════════════════════════════════════════ */

.page {
  display: none;
  padding: 2rem 0;
}

.page.active { display: block; }

.page-title {
  font-family: var(--font-heading);
  font-size: clamp(1.4rem, 3.5vw, 1.8rem);
  color: var(--gold);
  margin-bottom: 0.5rem;
  letter-spacing: 0.08em;
}

.page-subtitle {
  color: var(--text-secondary);
  margin-bottom: 2rem;
  font-style: italic;
}

/* ── Auth pages ───────────────────────────────── */

.auth-container {
  max-width: 400px;
  margin: 3rem auto;
}

.auth-container .card { padding: 2rem; }

.auth-container h2 {
  font-family: var(--font-heading);
  color: var(--gold);
  text-align: center;
  margin-bottom: 1.5rem;
  letter-spacing: 0.1em;
}

/* ── Sections ─────────────────────────────────── */

.section {
  margin-bottom: 3rem;
}

.section-title {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  color: var(--gold);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(201, 168, 76, 0.15);
  letter-spacing: 0.08em;
}

/* ── Group detail ─────────────────────────────── */

.group-header {
  padding: 2rem;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  margin-bottom: 2rem;
  border: 1px solid rgba(201, 168, 76, 0.1);
}

.group-header h1 {
  font-family: var(--font-heading);
  color: var(--gold);
  font-size: 1.8rem;
}

.group-stats {
  display: flex;
  gap: 2rem;
  margin-top: 1rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* ═══════════════════════════════════════════════════
   WATER DIVIDERS — Vodní čáry mezi sekcemi
   ═══════════════════════════════════════════════════ */

.water-line {
  position: relative;
  height: 20px;
  margin: 2rem 0;
  overflow: visible;
}

.water-line::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(80, 130, 180, 0.2) 15%,
    rgba(201, 168, 76, 0.25) 40%,
    rgba(160, 200, 240, 0.3) 50%,
    rgba(201, 168, 76, 0.25) 60%,
    rgba(80, 130, 180, 0.2) 85%,
    transparent 100%
  );
}

/* Subtle reflection glow below the line */
.water-line::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 10%;
  right: 10%;
  height: 15px;
  background: radial-gradient(
    ellipse at center,
    rgba(80, 130, 180, 0.04) 0%,
    transparent 70%
  );
}

/* ═══════════════════════════════════════════════════
   FOOTER — Pod hladinou
   ═══════════════════════════════════════════════════ */

.footer {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
  font-size: 0.8rem;
  position: relative;
  z-index: 1;
}

.footer .status-line {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  margin-top: 0.5rem;
  color: rgba(76, 175, 80, 0.4);
}

/* ═══════════════════════════════════════════════════
   CATEGORY SELECTOR — Regály knihovny
   ═══════════════════════════════════════════════════ */

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
}

.category-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  padding: 1rem 0.5rem;
  background: var(--bg-card);
  border: 1px solid rgba(201, 168, 76, 0.08);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.3s;
  text-align: center;
}

.category-card:hover {
  border-color: rgba(201, 168, 76, 0.25);
  background: var(--bg-card-hover);
}

.category-card.selected {
  border-color: var(--gold);
  background: rgba(201, 168, 76, 0.1);
  box-shadow: 0 0 15px rgba(201, 168, 76, 0.15);
}

.category-card-icon {
  font-size: 1.8rem;
}

.category-card-name {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  color: var(--text-primary);
  letter-spacing: 0.04em;
}

/* ── Emoji — Noto Color Emoji (Google) ─────── */
.emoji, .emoji-picker, .emoji-btn, .icon-pick-btn, .community-icon {
  font-family: 'Noto Color Emoji', sans-serif;
}

.emoji-picker-container {
  position: relative;
}

.emoji-picker {
  background: var(--bg-card);
  border: 1px solid var(--gold-dim);
  border-radius: var(--radius);
  padding: 0.75rem;
  max-height: 300px;
  overflow-y: auto;
  display: none;
}

.emoji-picker.open { display: block; }

.emoji-picker-tabs {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 0.5rem;
  border-bottom: 1px solid rgba(201, 168, 76, 0.15);
  padding-bottom: 0.5rem;
  overflow-x: auto;
}

.emoji-tab {
  font-size: 1.2rem;
  padding: 0.3rem 0.5rem;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: 4px;
  opacity: 0.5;
  transition: all 0.2s;
  font-family: 'Noto Color Emoji', sans-serif;
}

.emoji-tab:hover, .emoji-tab.active {
  opacity: 1;
  background: rgba(201, 168, 76, 0.1);
}

.emoji-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 2px;
}

.emoji-btn {
  font-size: 1.4rem;
  padding: 0.3rem;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.15s;
  text-align: center;
  line-height: 1;
}

.emoji-btn:hover {
  background: rgba(201, 168, 76, 0.15);
}

.emoji-toggle {
  font-size: 1.3rem;
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--gold-dim);
  border-radius: var(--radius);
  background: var(--bg-input);
  cursor: pointer;
  font-family: 'Noto Color Emoji', sans-serif;
}

.emoji-toggle:hover {
  border-color: var(--gold);
}

.icon-pick-btn.selected {
  border-color: var(--gold) !important;
  background: rgba(201, 168, 76, 0.15) !important;
  box-shadow: 0 0 8px rgba(201, 168, 76, 0.3);
}

.icon-pick-btn:hover {
  border-color: rgba(201, 168, 76, 0.4) !important;
}

.category-badge {
  font-size: 0.65rem;
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  background: rgba(66, 165, 245, 0.15);
  color: var(--blue);
  font-family: var(--font-mono);
}

.category-catchall {
  border-style: dashed;
}

/* Category section headings on communities page */
.category-section {
  margin-bottom: 2rem;
}

.category-heading {
  font-family: var(--font-heading);
  font-size: 1rem;
  color: var(--gold);
  margin-bottom: 0.75rem;
  letter-spacing: 0.06em;
}

/* ═══════════════════════════════════════════════════
   POKEC — Chat view
   ═══════════════════════════════════════════════════ */

.chat-container {
  display: flex;
  flex-direction: column;
  height: 60vh;
  background: var(--bg-card);
  border: 1px solid rgba(201, 168, 76, 0.1);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.chat-msg {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
}

.chat-msg-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-dark);
  border: 1px solid var(--gold-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  color: var(--gold);
  font-family: var(--font-heading);
  flex-shrink: 0;
}

.chat-msg-body {
  flex: 1;
  min-width: 0;
}

.chat-msg-author {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  color: var(--gold);
  display: inline;
  margin-right: 0.5rem;
}

.chat-msg-time {
  font-size: 0.65rem;
  color: var(--text-muted);
}

.chat-msg-text {
  color: var(--text-primary);
  font-size: 0.9rem;
  line-height: 1.5;
  word-break: break-word;
}

.chat-input {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem;
  border-top: 1px solid rgba(201, 168, 76, 0.1);
  background: var(--bg-dark);
}

.chat-input input {
  flex: 1;
  padding: 0.5rem 0.8rem;
  background: var(--bg-input);
  border: 1px solid rgba(201, 168, 76, 0.15);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.9rem;
}

.chat-input input:focus {
  outline: none;
  border-color: var(--gold);
}

/* ═══════════════════════════════════════════════════
   POKEC — Forum view
   ═══════════════════════════════════════════════════ */

.thread-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.thread-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid rgba(201, 168, 76, 0.06);
  border-radius: var(--radius);
  text-decoration: none;
  transition: all 0.3s;
}

.thread-item:hover {
  background: var(--bg-card-hover);
  border-color: rgba(201, 168, 76, 0.2);
}

.thread-title {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  color: var(--gold);
}

.thread-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.thread-stats {
  text-align: right;
  font-size: 0.8rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

.thread-pinned {
  border-left: 3px solid var(--gold);
}

/* Thread detail / reply view */
.thread-content {
  padding: 1.5rem;
  background: var(--bg-card);
  border: 1px solid rgba(201, 168, 76, 0.1);
  border-radius: var(--radius-lg);
  margin-bottom: 1.5rem;
}

.thread-content h2 {
  font-family: var(--font-heading);
  color: var(--gold);
  margin-bottom: 0.75rem;
}

.reply {
  padding: 1rem;
  border-bottom: 1px solid rgba(201, 168, 76, 0.06);
}

.reply:last-child { border-bottom: none; }

/* Channel type badges */
.channel-type-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
}

.channel-type-badge.chat {
  background: rgba(66, 165, 245, 0.15);
  color: var(--blue);
}

.channel-type-badge.forum {
  background: rgba(76, 175, 80, 0.15);
  color: var(--green);
}

/* Default vs custom channel cards */
.channel-default {
  border-left: 2px solid var(--gold-dim);
}

.channel-custom {
  border-left: 2px solid transparent;
}

/* Sub-thread count badge */
.sub-count {
  display: inline-block;
  margin-left: 0.5rem;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  font-size: 0.7rem;
  background: rgba(201, 168, 76, 0.12);
  color: var(--gold);
}

/* Sub-thread items */
.thread-sub {
  border-left: 3px solid rgba(201, 168, 76, 0.25);
  margin-left: 0.5rem;
}

.sub-threads {
  margin-bottom: 1rem;
}

/* Thread breadcrumbs */
.thread-breadcrumbs {
  font-size: 0.85rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.thread-breadcrumbs a {
  transition: opacity 0.2s;
}

.thread-breadcrumbs a:hover {
  opacity: 0.8;
}

/* Depth badge */
.depth-badge {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  margin-bottom: 0.75rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-family: var(--font-mono);
  background: rgba(201, 168, 76, 0.1);
  color: var(--gold-dim);
  letter-spacing: 0.05em;
}

/* ═══════════════════════════════════════════════════
   VEREJNY PROFIL
   ═══════════════════════════════════════════════════ */

.profile-avatar-lg {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 2px solid var(--gold-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  color: var(--gold);
  font-family: var(--font-heading);
  flex-shrink: 0;
}

.interest-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.interest-tag {
  display: inline-block;
  padding: 0.25rem 0.65rem;
  border-radius: 12px;
  font-size: 0.8rem;
  background: rgba(201, 168, 76, 0.1);
  color: var(--gold);
  border: 1px solid rgba(201, 168, 76, 0.15);
}

/* ═══════════════════════════════════════════════════
   VYHLEDAVANI — search bar
   ═══════════════════════════════════════════════════ */

.search-bar {
  display: flex;
  gap: 0.5rem;
}

.search-input {
  flex: 1;
  padding: 0.6rem 1rem;
  background: var(--bg-input);
  border: 1px solid rgba(201, 168, 76, 0.15);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 1rem;
}

.search-input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 2px var(--gold-glow);
}

/* ═══════════════════════════════════════════════════
   NOTIFIKACE — bell, list, items
   ═══════════════════════════════════════════════════ */

.notif-bell {
  position: relative;
  padding: 0.35rem 0.6rem;
}

.notif-icon {
  font-size: 1rem;
}

.notif-count {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--red);
  color: #fff;
  font-size: 0.6rem;
  font-family: var(--font-mono);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.notif-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.notif-item {
  display: flex;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--bg-card);
  border: 1px solid rgba(201, 168, 76, 0.06);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.3s;
}

.notif-item:hover {
  background: var(--bg-card-hover);
  border-color: rgba(201, 168, 76, 0.2);
}

.notif-unread {
  border-left: 3px solid var(--gold);
}

.notif-read {
  opacity: 0.6;
}

.notif-type-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
  width: 2rem;
  text-align: center;
}

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

.notif-title {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  color: var(--gold);
  margin-bottom: 0.15rem;
}

.notif-text {
  font-size: 0.85rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.notif-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

/* ═══════════════════════════════════════════════════
   MODERACE — zamknout, pripnout, skryt
   ═══════════════════════════════════════════════════ */

/* Locked badge inline */
.locked-badge {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  border-radius: 4px;
  font-size: 0.65rem;
  font-family: var(--font-mono);
  background: rgba(244, 67, 54, 0.15);
  color: var(--red);
  letter-spacing: 0.04em;
  vertical-align: middle;
}

.pinned-badge {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  border-radius: 4px;
  font-size: 0.65rem;
  font-family: var(--font-mono);
  background: rgba(201, 168, 76, 0.15);
  color: var(--gold);
  letter-spacing: 0.04em;
  vertical-align: middle;
}

/* Locked notice bar */
.locked-notice {
  padding: 0.6rem 1rem;
  margin-bottom: 1rem;
  background: rgba(244, 67, 54, 0.08);
  border: 1px solid rgba(244, 67, 54, 0.2);
  border-radius: var(--radius);
  color: var(--red);
  font-size: 0.85rem;
  text-align: center;
}

.chat-locked-bar {
  padding: 0.75rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  border-top: 1px solid rgba(244, 67, 54, 0.15);
  background: rgba(244, 67, 54, 0.04);
}

/* Mod action buttons */
.mod-actions {
  display: flex;
  gap: 0.35rem;
  flex-shrink: 0;
}

.btn-mod {
  border-color: var(--text-muted);
  color: var(--text-muted);
  font-size: 0.7rem;
  padding: 0.3rem 0.7rem;
}

.btn-mod:hover {
  border-color: var(--red);
  color: var(--red);
  background: rgba(244, 67, 54, 0.08);
}

.btn-mod-active {
  border-color: var(--red);
  color: var(--red);
  background: rgba(244, 67, 54, 0.1);
  font-size: 0.7rem;
  padding: 0.3rem 0.7rem;
}

.btn-mod-active:hover {
  background: rgba(244, 67, 54, 0.2);
}

/* Inline mod button (on messages) */
.btn-mod-inline {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.7rem;
  font-family: var(--font-mono);
  cursor: pointer;
  padding: 0.15rem 0.3rem;
  opacity: 0;
  transition: opacity 0.2s, color 0.2s;
}

.chat-msg:hover .btn-mod-inline,
.reply:hover .btn-mod-inline {
  opacity: 1;
}

.btn-mod-inline:hover {
  color: var(--red);
}

/* Hidden messages */
.msg-hidden,
.reply-hidden {
  opacity: 0.5;
}

/* Locked thread in list */
.thread-locked {
  opacity: 0.7;
}

/* ═══════════════════════════════════════════════════
   SAP FINANCIAL — Dashboard, tabulky, alerty
   ═══════════════════════════════════════════════════ */

/* Summary cards — 4 stat karty */
.fin-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.fin-stat {
  background: var(--bg-card);
  border: 1px solid rgba(201, 168, 76, 0.1);
  border-radius: var(--radius);
  padding: 1.25rem;
  text-align: center;
}

.fin-stat-value {
  font-family: var(--font-mono);
  font-size: 1.6rem;
  color: var(--gold);
  margin-bottom: 0.25rem;
}

.fin-stat-label {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  color: var(--text-secondary);
  letter-spacing: 0.06em;
}

.fin-stat.positive .fin-stat-value { color: var(--green); }
.fin-stat.negative .fin-stat-value { color: var(--red); }

/* Financial table */
.fin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.fin-table th {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  color: var(--text-secondary);
  letter-spacing: 0.05em;
  text-align: left;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid rgba(201, 168, 76, 0.15);
}

.fin-table td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid rgba(201, 168, 76, 0.06);
  color: var(--text-primary);
}

.fin-table tr:hover td {
  background: rgba(201, 168, 76, 0.04);
}

.fin-table .amount-in {
  color: var(--green);
  font-family: var(--font-mono);
}

.fin-table .amount-out {
  color: var(--red);
  font-family: var(--font-mono);
}

/* Status badges (invoices, stock) */
.status-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
}

.status-badge.draft    { background: rgba(138, 126, 106, 0.2); color: var(--text-secondary); }
.status-badge.sent     { background: rgba(66, 165, 245, 0.15); color: var(--blue); }
.status-badge.paid     { background: rgba(76, 175, 80, 0.15); color: var(--green); }
.status-badge.overdue  { background: rgba(244, 67, 54, 0.15); color: var(--red); }
.status-badge.cancelled { background: rgba(90, 80, 64, 0.2); color: var(--text-muted); }

/* Stock badge */
.stock-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-family: var(--font-mono);
}

.stock-badge.ok    { background: rgba(76, 175, 80, 0.15); color: var(--green); }
.stock-badge.low   { background: rgba(255, 152, 0, 0.15); color: var(--orange); }
.stock-badge.empty { background: rgba(244, 67, 54, 0.15); color: var(--red); }

/* Alert cards (heuristics) */
.alert-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.alert-card {
  display: flex;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--bg-card);
  border-radius: var(--radius);
  border-left: 3px solid var(--text-muted);
  align-items: center;
}

.alert-card.high    { border-left-color: var(--red); }
.alert-card.medium  { border-left-color: var(--orange); }
.alert-card.low     { border-left-color: var(--blue); }

.alert-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
}

.alert-body {
  flex: 1;
}

.alert-title {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  color: var(--text-primary);
}

.alert-text {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* Inline form (add transaction, product, etc.) */
.fin-form {
  background: var(--bg-card);
  border: 1px solid rgba(201, 168, 76, 0.1);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.fin-form h4 {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  color: var(--gold);
  margin-bottom: 0.75rem;
  letter-spacing: 0.05em;
}

.fin-form-row {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.fin-form-row .form-group {
  flex: 1;
  min-width: 140px;
  margin-bottom: 0;
}

/* Trend indicators */
.trend-up   { color: var(--green); }
.trend-down { color: var(--red); }
.trend-flat { color: var(--text-muted); }

/* HR employee status badges */
.stock-badge.warn {
  background: rgba(201, 168, 76, 0.15);
  color: var(--gold);
  border-color: rgba(201, 168, 76, 0.3);
}
.stock-badge.off {
  background: rgba(180, 40, 40, 0.15);
  color: #e06060;
  border-color: rgba(180, 40, 40, 0.3);
}

/* Small button for inline actions */
.btn-small {
  padding: 0.2rem 0.6rem;
  font-size: 0.75rem;
  border-radius: 4px;
}

/* ═══════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════
   CHAT LAYOUT — sidebar + messages
   ═══════════════════════════════════════════════════ */

.chat-layout {
  display: flex;
  gap: 1rem;
}

.chat-main {
  flex: 1;
  min-width: 0;
}

.chat-sidebar {
  width: 200px;
  flex-shrink: 0;
  background: var(--bg-card);
  border: 1px solid rgba(201, 168, 76, 0.1);
  border-radius: var(--radius);
  padding: 1rem;
  max-height: 70vh;
  overflow-y: auto;
}

/* ── Bridged chat: mirror-verse + external launcher (xchat etc.) ── */
.chat-layout-bridged .chat-main { flex: 1 1 0; }
.chat-layout-bridged .chat-sidebar { width: 160px; }

.chat-external {
  width: 280px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid rgba(80, 160, 240, 0.25);
  border-radius: var(--radius-lg);
  overflow: hidden;
  height: 60vh;
}

/* iframe variant — wider, no fixed width */
.chat-external.chat-external-iframe {
  width: auto;
  flex: 1 1 0;
  min-width: 0;
}

.chat-external-frame {
  flex: 1;
  width: 100%;
  border: 0;
  background: #000;
}

/* YouTube search bar + results */
.chat-external-search {
  display: flex;
  gap: 0.4rem;
  padding: 0.5rem 0.6rem;
  background: var(--bg-dark);
  border-bottom: 1px solid rgba(80, 160, 240, 0.15);
}
.chat-external-search input {
  flex: 1;
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid rgba(80, 160, 240, 0.3);
  border-radius: 4px;
  padding: 0.35rem 0.6rem;
  font-size: 0.85rem;
}
.chat-external-search input:focus { outline: 1px solid #5fa8ff; }

.chat-external-results {
  position: absolute;
  z-index: 30;
  margin-top: 0;
  max-height: 60vh;
  overflow-y: auto;
  background: var(--bg-card);
  border: 1px solid rgba(80, 160, 240, 0.4);
  border-radius: var(--radius);
  box-shadow: 0 6px 24px rgba(0,0,0,0.45);
  width: calc(100% - 1.2rem);
  left: 0.6rem;
}
.yt-result {
  display: flex;
  gap: 0.6rem;
  padding: 0.5rem;
  cursor: pointer;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  transition: background 0.12s;
}
.yt-result:hover { background: rgba(80, 160, 240, 0.08); }
.yt-result-thumb {
  position: relative;
  width: 110px;
  height: 62px;
  flex-shrink: 0;
  background: #000;
  border-radius: 3px;
  overflow: hidden;
}
.yt-result-thumb img { width: 100%; height: 100%; object-fit: cover; }
.yt-dur, .yt-live {
  position: absolute;
  bottom: 3px;
  right: 3px;
  background: rgba(0,0,0,0.85);
  color: #fff;
  font-size: 0.65rem;
  padding: 1px 4px;
  border-radius: 2px;
}
.yt-live { background: #d32f2f; }
.yt-result-meta { flex: 1; min-width: 0; }
.yt-result-title {
  font-size: 0.8rem;
  color: var(--text-primary);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.yt-result-channel {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}
.yt-result-loading {
  padding: 1rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
}
.lichess-user {
  background: rgba(80, 160, 240, 0.06);
  border-bottom: 1px solid rgba(80, 160, 240, 0.2);
}
.lichess-title {
  background: #c9a84c;
  color: #1a1a1a;
  padding: 0.05rem 0.3rem;
  border-radius: 3px;
  font-size: 0.7rem;
  font-weight: bold;
}

/* Make .chat-external position relative so absolute results can anchor to it */
.chat-external { position: relative; }

.chat-external-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  background: var(--bg-dark);
  border-bottom: 1px solid rgba(80, 160, 240, 0.2);
}

.chat-external-title {
  font-family: var(--font-heading);
  font-size: 0.8rem;
  color: #5fa8ff;
  letter-spacing: 0.05em;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.chat-external-select {
  background: var(--bg-card);
  color: #5fa8ff;
  border: 1px solid rgba(80, 160, 240, 0.4);
  border-radius: 4px;
  padding: 0.2rem 0.4rem;
  font-family: var(--font-heading);
  font-size: 0.75rem;
  cursor: pointer;
  max-width: 220px;
}
.chat-external-select:focus { outline: 1px solid #5fa8ff; }

.chat-external-open {
  color: #5fa8ff;
  text-decoration: none;
  font-size: 1.1rem;
  padding: 0 0.4rem;
}
.chat-external-open:hover { color: #8fc5ff; }

.chat-external-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1.25rem 1rem;
  gap: 0.6rem;
}

.chat-external-icon {
  font-size: 2.6rem;
  line-height: 1;
}

.chat-external-name {
  font-family: var(--font-heading);
  font-size: 1rem;
  color: var(--text-primary);
}

.chat-external-status {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.chat-external-launch {
  margin-top: 0.4rem;
}

.chat-external-hint {
  font-size: 0.7rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-top: 0.4rem;
}

.chat-external-foot {
  padding: 0.4rem 0.75rem;
  font-size: 0.65rem;
  color: var(--text-muted);
  background: var(--bg-dark);
  border-top: 1px solid rgba(80, 160, 240, 0.15);
  text-align: center;
}

/* Screen Capture stream into slot (popup → <video>) */
.chat-external-stream {
  background: rgba(80, 160, 240, 0.12);
  color: #5fa8ff;
  border: 1px solid rgba(80, 160, 240, 0.4);
}
.chat-external-stream:hover { background: rgba(80, 160, 240, 0.22); }

.chat-external-stream-wrap {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  overflow: hidden;
  min-height: 320px;
}
.chat-external-stream-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.chat-external-stream-stop {
  position: absolute;
  top: 6px;
  right: 6px;
  background: rgba(0,0,0,0.7);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 50%;
  width: 26px;
  height: 26px;
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.chat-external-stream-stop:hover { background: rgba(220, 50, 50, 0.85); }

/* XChat text bridge button + stream panel */
.chat-external-text-stream {
  background: rgba(140, 80, 240, 0.12);
  color: #b58aff;
  border: 1px solid rgba(140, 80, 240, 0.4);
}
.chat-external-text-stream:hover { background: rgba(140, 80, 240, 0.22); }

.xchat-text-stream {
  display: flex;
  flex-direction: column;
  flex: 1;
  background: var(--bg-dark);
  overflow: hidden;
  min-height: 320px;
}
.xchat-text-stream-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  background: rgba(140, 80, 240, 0.12);
  border-bottom: 1px solid rgba(140, 80, 240, 0.3);
  font-size: 0.75rem;
  color: #b58aff;
  font-family: var(--font-heading);
  letter-spacing: 0.05em;
}
.xchat-text-stream-body {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.xchat-text-msg {
  font-size: 0.82rem;
  line-height: 1.35;
  word-break: break-word;
  color: var(--text-primary);
  padding: 0.15rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.xchat-text-msg.xchat-text-system {
  color: var(--text-muted);
  font-style: italic;
  font-size: 0.75rem;
  text-align: center;
  border: 0;
}
.xchat-text-time {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-family: var(--font-heading);
  margin-right: 0.3rem;
}
.xchat-text-author {
  color: #b58aff;
  font-weight: 600;
  margin-right: 0.3rem;
}
.xchat-text-body { color: var(--text-primary); }

/* Bridge dialog steps + bookmarklet link */
.bridge-step {
  display: flex;
  gap: 0.6rem;
  margin: 0.6rem 0;
  font-size: 0.85rem;
  color: var(--text-primary);
}
.bridge-step-num {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  background: rgba(140, 80, 240, 0.2);
  color: #b58aff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: 0.8rem;
}
.bridge-bookmarklet {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: linear-gradient(135deg, #b58aff, #6a4cff);
  color: #fff;
  text-decoration: none;
  border-radius: 6px;
  font-family: var(--font-heading);
  font-size: 0.85rem;
  cursor: grab;
  user-select: none;
}
.bridge-bookmarklet:active { cursor: grabbing; }

.bridge-section {
  margin: 1rem 0;
  padding: 0.8rem;
  background: rgba(140, 80, 240, 0.05);
  border: 1px solid rgba(140, 80, 240, 0.15);
  border-radius: 6px;
}
.bridge-section-title {
  margin: 0 0 0.5rem 0;
  font-size: 0.85rem;
  color: #b58aff;
  font-family: var(--font-heading);
  letter-spacing: 0.03em;
}
.bridge-section code {
  background: rgba(0,0,0,0.4);
  padding: 0.05rem 0.3rem;
  border-radius: 3px;
  font-family: monospace;
  font-size: 0.8rem;
  color: #b58aff;
}

/* ── Message reactions ── */
.chat-msg-reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: 0.25rem;
}
.chat-msg-reactions:empty { display: none; }
.msg-rx-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.1rem 0.45rem;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  font-size: 0.75rem;
  cursor: pointer;
  color: var(--text-primary);
  line-height: 1.4;
  transition: background 0.12s, border-color 0.12s;
}
.msg-rx-pill:hover { background: rgba(80, 160, 240, 0.15); border-color: rgba(80, 160, 240, 0.4); }
.msg-rx-pill.mine { background: rgba(80, 160, 240, 0.2); border-color: rgba(80, 160, 240, 0.6); }
.msg-rx-emoji { font-size: 0.85rem; }
.msg-rx-count { font-size: 0.7rem; color: var(--text-muted); }
.msg-rx-pill.mine .msg-rx-count { color: #5fa8ff; }

.msg-react-btn {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  font-size: 0.7rem;
  padding: 0.1rem 0.4rem;
  margin-left: 0.4rem;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.12s;
}
.msg-react-btn:hover { color: #5fa8ff; border-color: rgba(80, 160, 240, 0.5); }

.msg-rx-picker {
  display: flex;
  gap: 0.25rem;
  background: var(--bg-card);
  border: 1px solid rgba(80, 160, 240, 0.4);
  border-radius: 24px;
  padding: 0.4rem 0.6rem;
  z-index: 1000;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}
.msg-rx-pick-btn {
  background: transparent;
  border: 0;
  font-size: 1.3rem;
  cursor: pointer;
  padding: 0.2rem;
  border-radius: 6px;
  transition: transform 0.12s, background 0.12s;
  line-height: 1;
}
.msg-rx-pick-btn:hover { transform: scale(1.3); background: rgba(80, 160, 240, 0.15); }

/* ── Polls in chat ── */
.poll-block {
  background: rgba(80, 160, 240, 0.06);
  border: 1px solid rgba(80, 160, 240, 0.2);
  border-radius: var(--radius);
  padding: 0.7rem 0.9rem;
  margin-top: 0.3rem;
  max-width: 480px;
}
.poll-question {
  font-size: 0.95rem;
  color: var(--text-primary);
  margin-bottom: 0.6rem;
  font-family: var(--font-heading);
}
.poll-multi-tag {
  font-size: 0.65rem;
  background: rgba(80,160,240,0.2);
  color: #5fa8ff;
  padding: 0.1rem 0.4rem;
  border-radius: 8px;
  margin-left: 0.4rem;
  font-family: inherit;
}
.poll-loading {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
  padding: 0.5rem;
}
.poll-options {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.poll-option {
  position: relative;
  display: block;
  width: 100%;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 6px;
  padding: 0.5rem 0.7rem;
  text-align: left;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text-primary);
  overflow: hidden;
  transition: background 0.12s, border-color 0.12s;
}
.poll-option-vote:hover {
  background: rgba(80,160,240,0.15);
  border-color: rgba(80,160,240,0.45);
}
.poll-option-result { cursor: default; }
.poll-option-bar {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  background: rgba(80,160,240,0.18);
  z-index: 0;
  transition: width 0.4s ease;
}
.poll-option.mine .poll-option-bar { background: rgba(80,160,240,0.35); }
.poll-option.mine { border-color: rgba(80,160,240,0.6); }
.poll-option-text {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}
.poll-option-stats {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-family: var(--font-heading);
}
.poll-foot {
  margin-top: 0.5rem;
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* ── Modal overlay (shared) ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 1rem;
}
.modal-card {
  background: var(--bg-card);
  border: 1px solid rgba(201, 168, 76, 0.3);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 12px 40px rgba(0,0,0,0.6);
}
.poll-label {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted);
  font-family: var(--font-heading);
  letter-spacing: 0.05em;
  margin-bottom: 0.3rem;
}
.poll-option-input {
  width: 100%;
  background: var(--bg-dark);
  color: var(--text-primary);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 4px;
  padding: 0.4rem 0.6rem;
  margin-bottom: 0.4rem;
  font-size: 0.85rem;
}
.poll-option-input:focus { outline: 1px solid var(--gold); }

@media (max-width: 1100px) {
  .chat-layout-bridged { flex-wrap: wrap; }
  .chat-layout-bridged .chat-main { flex: 1 1 100%; }
  .chat-layout-bridged .chat-external { width: 100%; height: auto; min-height: 220px; }
  .chat-layout-bridged .chat-sidebar { width: 100%; max-height: 120px; }
}

.online-user {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.4rem;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s;
}

.online-user:hover {
  background: rgba(201, 168, 76, 0.1);
}

.online-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  flex-shrink: 0;
}

.online-name {
  font-size: 0.85rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.online-avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════
   USER POPUP
   ═══════════════════════════════════════════════════ */

.user-popup {
  background: var(--bg-card);
  border: 1px solid var(--gold-dim);
  border-radius: var(--radius);
  padding: 0.75rem;
  min-width: 180px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

.user-popup-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(201, 168, 76, 0.15);
  color: var(--text-primary);
}

.user-popup-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
}

.user-popup-avatar-placeholder {
  width: 32px;
  height: 32px;
  font-size: 1.5rem;
  text-align: center;
  line-height: 32px;
}

.user-popup-actions {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.user-popup-btn {
  display: block;
  padding: 0.4rem 0.6rem;
  color: var(--text-primary);
  text-decoration: none;
  font-size: 0.85rem;
  border-radius: 4px;
  transition: background 0.15s;
  font-family: 'Noto Color Emoji', var(--font-body);
}

.user-popup-btn:hover {
  background: rgba(201, 168, 76, 0.15);
  color: var(--gold);
}

/* ═══════════════════════════════════════════════════
   DM — Direct Messages
   ═══════════════════════════════════════════════════ */

.dm-conversation:hover {
  border-color: rgba(201, 168, 76, 0.3);
}

.dm-unread-badge {
  display: inline-block;
  background: var(--gold);
  color: var(--bg-deep);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.1rem 0.4rem;
  border-radius: 10px;
  margin-left: 0.5rem;
}

.chat-msg-mine {
  background: rgba(201, 168, 76, 0.05);
  border-left: 2px solid var(--gold-dim);
}

/* ═══════════════════════════════════════════════════
   ANTI-COPY — ochrana obsahu chatu
   ═══════════════════════════════════════════════════ */

.chat-messages {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

.chat-msg-text {
  -webkit-user-select: none;
  user-select: none;
}

/* Input fields must remain selectable */
.chat-input input, .chat-input textarea {
  -webkit-user-select: text;
  user-select: text;
}

/* Watermark overlay — invisible but shows on screenshot */
.chat-watermark {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  z-index: 10;
  overflow: hidden;
  opacity: 0.03;
}

.chat-watermark-text {
  font-size: 12px;
  color: white;
  transform: rotate(-30deg);
  white-space: nowrap;
  position: absolute;
  font-family: monospace;
  letter-spacing: 2px;
}

/* Report button */
.report-btn {
  font-size: 0.7rem;
  color: var(--text-muted);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s;
  border: none;
  background: none;
  padding: 0.1rem 0.3rem;
}

.chat-msg:hover .report-btn {
  opacity: 0.6;
}

.report-btn:hover {
  opacity: 1 !important;
  color: var(--red);
}

/* ═══════════════════════════════════════════════════
   AVATARS & GENDER
   ═══════════════════════════════════════════════════ */

:root {
  --pink: #e91e63;
}

.avatar-male {
  border: 2px solid var(--blue) !important;
}

.avatar-female {
  border: 2px solid var(--pink) !important;
}

.chat-avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.profile-avatar-lg {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 2px solid var(--gold-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--gold);
  font-family: var(--font-heading);
  flex-shrink: 0;
  overflow: hidden;
}

.profile-avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.gender-badge {
  font-size: 0.75rem;
  padding: 0.15rem 0.5rem;
  border-radius: 10px;
}

.gender-badge.male {
  background: rgba(66, 165, 245, 0.15);
  color: var(--blue);
}

.gender-badge.female {
  background: rgba(233, 30, 99, 0.15);
  color: var(--pink);
}

/* ═══════════════════════════════════════════════════
   STATS BAR (homepage)
   ═���═══════════��═════════════════════════════════════ */

.stats-bar {
  display: flex;
  justify-content: center;
  gap: 2rem;
  padding: 1.5rem 0;
  flex-wrap: wrap;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
}

.stat-num {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  color: var(--gold);
}

.stat-num.stat-online {
  color: var(--green);
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ═════��═════════════════════════════════════════════
   GALLERY
   ═══════════════════════════════════════════════════ */

.album-cover {
  width: 100%;
  height: 140px;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 0.75rem;
  background: var(--bg-deep);
}

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

.album-cover-empty {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: var(--text-muted);
}

.visibility-badge {
  font-size: 0.7rem;
  padding: 0.1rem 0.4rem;
  border-radius: 8px;
}

.visibility-badge.public { background: rgba(76, 175, 80, 0.15); color: var(--green); }
.visibility-badge.community { background: rgba(66, 165, 245, 0.15); color: var(--blue); }
.visibility-badge.private { background: rgba(201, 168, 76, 0.15); color: var(--gold); }

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.75rem;
}

.photo-item {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 1;
  background: var(--bg-deep);
}

.photo-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.photo-item:hover img {
  transform: scale(1.05);
}

.photo-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.4rem 0.5rem;
  background: rgba(0,0,0,0.7);
  color: var(--text-primary);
  font-size: 0.75rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.photo-delete {
  position: absolute;
  top: 0.3rem;
  right: 0.3rem;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  background: rgba(244, 67, 54, 0.8);
  color: white;
  font-size: 1rem;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.photo-item:hover .photo-delete { display: flex; }

/* ── Lightbox ── */
.lightbox {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.95);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: var(--radius);
}

.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 2rem;
  background: none;
  border: none;
  color: white;
  cursor: pointer;
}

.lightbox-prev, .lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 3rem;
  background: none;
  border: none;
  color: rgba(255,255,255,0.7);
  cursor: pointer;
  padding: 1rem;
}

.lightbox-prev { left: 1rem; }
.lightbox-next { right: 1rem; }
.lightbox-prev:hover, .lightbox-next:hover { color: white; }

.lightbox-caption {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,0.8);
  font-size: 0.9rem;
  text-align: center;
}

/* ── Desktop wide (1400px+) ── */
@media (min-width: 1400px) {
  :root { --max-width: 1400px; }
  .fin-summary { grid-template-columns: repeat(4, 1fr); }
}

/* ── Mobile (do 768px) ── */
@media (max-width: 768px) {
  .nav { gap: 0.75rem; }
  .nav a { font-size: 0.7rem; }
  .card-grid { grid-template-columns: 1fr; }
  .group-stats { flex-direction: column; gap: 0.5rem; }
  .hero { min-height: 60vh; }
  .persona-tabs { overflow-x: auto; }
  .chat-container { height: 50vh; }
  .chat-layout { flex-direction: column; }
  .chat-sidebar { width: 100%; max-height: 120px; flex-direction: row; display: flex; flex-wrap: wrap; gap: 0.5rem; }
  .thread-item { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
  .thread-stats { text-align: left; }
  .fin-summary { grid-template-columns: repeat(2, 1fr); }
  .fin-form-row { flex-direction: column; }
  .fin-table { font-size: 0.8rem; }
  .fin-table th, .fin-table td { padding: 0.4rem 0.5rem; }
  .container { padding: 0 0.75rem; }
}

/* ── Mobile small (do 480px) ── */
@media (max-width: 480px) {
  .header .container { flex-direction: column; gap: 0.5rem; }
  .nav { flex-wrap: wrap; justify-content: center; }
  .hero-title { font-size: 2rem; }
  .auth-container { max-width: 100%; }
}

/* ═══════════════════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════════════════ */

@keyframes fade-in-up {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in {
  animation: fade-in-up 0.6s ease-out;
}

/* Status 515 pulse */
@keyframes pulse-515 {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.status-515 {
  animation: pulse-515 4s ease-in-out infinite;
}

/* ═══ TRANSPORT / AUTODOPRAVA ═══ */

.transport-summary {
  border-left: 3px solid var(--primary, #3b82f6);
}

.eta-badge.transport {
  background: #1e40af;
  color: #fff;
}

/* Expiry date coloring */
.expiry-expired { color: #ef4444 !important; font-weight: 700; }
.expiry-warning-text { color: #f59e0b !important; font-weight: 600; }
.expiry-soon-text { color: #eab308 !important; }
.expiry-critical td { background: rgba(239, 68, 68, 0.08) !important; }
.expiry-warning td { background: rgba(245, 158, 11, 0.06) !important; }

/* Aggregated expiry pill (vehicle/driver row summary) */
.expiry-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.15rem 0.4rem;
  border-radius: 10px;
  font-size: 0.85rem;
  line-height: 1;
  white-space: nowrap;
  cursor: help;
}
.expiry-pill-count {
  font-size: 0.7rem;
  font-weight: 700;
  font-family: var(--font-heading);
}
.expiry-pill.ok {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
  font-weight: 700;
}
.expiry-pill.critical {
  background: rgba(239, 68, 68, 0.18);
  border: 1px solid rgba(239, 68, 68, 0.5);
  color: #ef4444;
  animation: expiry-pulse 2s ease-in-out infinite;
}
.expiry-pill.warning {
  background: rgba(245, 158, 11, 0.18);
  border: 1px solid rgba(245, 158, 11, 0.5);
  color: #f59e0b;
}
.expiry-pill.soon {
  background: rgba(234, 179, 8, 0.15);
  border: 1px solid rgba(234, 179, 8, 0.4);
  color: #eab308;
}
@keyframes expiry-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
  50%      { box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.0); }
}

/* ── Order detail modal ── */
.order-detail-section {
  background: var(--bg-dark);
  border: 1px solid rgba(201, 168, 76, 0.08);
  border-radius: 6px;
  padding: 0.75rem 1rem;
  margin-bottom: 0.75rem;
}
.order-detail-section h4 {
  margin: 0 0 0.6rem;
  color: var(--gold);
  font-family: var(--font-heading);
  font-size: 0.85rem;
  letter-spacing: 0.05em;
}
.order-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.4rem 1rem;
  font-size: 0.85rem;
}
.order-detail-grid .lbl {
  color: var(--text-muted);
  font-size: 0.75rem;
  margin-right: 0.3rem;
}

/* ── Validation panel ── */
.validation-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 0.8rem;
  border-radius: 6px;
  margin-bottom: 0.5rem;
  font-size: 0.85rem;
}
.validation-summary.ok {
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.35);
  color: #22c55e;
}
.validation-summary.warning {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #f59e0b;
}
.validation-summary.conflict {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #ef4444;
}
.validation-summary span {
  color: var(--text-muted);
  font-size: 0.75rem;
  font-family: var(--font-heading);
}

.validation-rows {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.validation-row {
  display: flex;
  gap: 0.6rem;
  padding: 0.4rem 0.6rem;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.02);
  border-left: 3px solid transparent;
  font-size: 0.85rem;
}
.validation-row.validation-ok { border-left-color: rgba(34, 197, 94, 0.6); }
.validation-row.validation-warning { border-left-color: rgba(245, 158, 11, 0.6); background: rgba(245, 158, 11, 0.04); }
.validation-row.validation-conflict { border-left-color: rgba(239, 68, 68, 0.7); background: rgba(239, 68, 68, 0.06); }
.validation-row.validation-unknown { border-left-color: rgba(138, 130, 120, 0.5); background: rgba(255,255,255,0.02); }

.validation-icon {
  flex-shrink: 0;
  width: 20px;
  text-align: center;
  font-weight: 700;
}
.validation-row.validation-ok .validation-icon { color: #22c55e; }
.validation-row.validation-warning .validation-icon { color: #f59e0b; }
.validation-row.validation-conflict .validation-icon { color: #ef4444; }
.validation-row.validation-unknown .validation-icon { color: var(--text-muted); }

.validation-body { flex: 1; min-width: 0; }
.validation-name {
  font-weight: 600;
  color: var(--text);
  font-size: 0.82rem;
}
.validation-detail {
  color: var(--text-muted);
  font-size: 0.75rem;
  margin-top: 0.1rem;
}

/* Extra small button variant */
.btn-xs {
  padding: 0.2rem 0.5rem;
  font-size: 0.7rem;
  border-radius: 4px;
}

/* ── Driver absences ── */
.absence-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 10px;
  font-size: 0.7rem;
  font-weight: 600;
  font-family: var(--font-heading);
  letter-spacing: 0.03em;
}
.absence-vacation { background: rgba(80, 160, 240, 0.2); color: #5fa8ff; }
.absence-sick { background: rgba(239, 68, 68, 0.2); color: #ef4444; }
.absence-training { background: rgba(201, 168, 76, 0.2); color: var(--gold); }
.absence-personal { background: rgba(140, 80, 240, 0.2); color: #b58aff; }
.absence-unpaid { background: rgba(245, 158, 11, 0.2); color: #f59e0b; }
.absence-other { background: rgba(138, 130, 120, 0.2); color: var(--text-muted); }

.absence-active td { background: rgba(80, 160, 240, 0.08) !important; }
.absence-past td { opacity: 0.55; }

/* Alert banners */
.alert-banner {
  border-radius: 8px;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
}
.alert-critical {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
}
.alert-warning {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.25);
}
.alert-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0;
  font-size: 0.85rem;
}
.alert-sev { font-size: 1rem; flex-shrink: 0; }

/* Tacho grid — řidiči karty */
.tacho-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
}
.tacho-card {
  background: var(--bg-secondary, #1e1e2e);
  border: 1px solid var(--border, #3a3a4e);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  transition: border-color 0.2s;
}
.tacho-card:hover { border-color: var(--primary, #3b82f6); }
.tacho-violation { border-left: 3px solid #ef4444; }
.tacho-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}
.tacho-bar-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.25rem 0;
}
.tacho-bar-label {
  font-size: 0.75rem;
  color: var(--text-muted, #6b7280);
  width: 35px;
  flex-shrink: 0;
}
.tacho-bar-value {
  font-size: 0.8rem;
  font-weight: 600;
  width: 50px;
  text-align: right;
  flex-shrink: 0;
}
.tacho-remaining {
  font-size: 0.8rem;
  color: var(--text-secondary, #9ca3af);
  width: 65px;
  flex-shrink: 0;
}
.tacho-violation-badge {
  background: #7f1d1d;
  color: #fca5a5;
  border-radius: 4px;
  padding: 0.1rem 0.4rem;
  font-size: 0.75rem;
  font-weight: 600;
}

/* Forecast — zbývající dny v týdnu */
.tacho-forecast {
  display: flex;
  gap: 4px;
  margin-top: 0.4rem;
}
.forecast-day {
  text-align: center;
  border-radius: 4px;
  padding: 0.2rem 0.4rem;
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1.3;
  min-width: 36px;
}
.forecast-full { background: #064e3b; color: #34d399; }
.forecast-mid { background: #1e3a5f; color: #7dd3fc; }
.forecast-low { background: #92400e; color: #fcd34d; }
.forecast-zero { background: #7f1d1d; color: #fca5a5; }

/* ═══ GAMES ═══ */

/* Game picker */
.game-picker {
  position: absolute; bottom: 100%; left: 40px; margin-bottom: 0.5rem;
  background: var(--bg-primary, #0f0f1a); border: 1px solid var(--border, #3a3a4e);
  border-radius: 8px; padding: 0.75rem; z-index: 50; min-width: 200px;
}
.game-picker-title { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 0.5rem; text-transform: uppercase; letter-spacing: 0.05em; }
.game-pick-btn {
  display: flex; align-items: center; gap: 0.5rem; width: 100%;
  background: var(--bg-secondary, #1e1e2e); border: 1px solid var(--border, #3a3a4e);
  border-radius: 6px; padding: 0.5rem; margin-bottom: 0.4rem; cursor: pointer;
  color: var(--text-primary); transition: border-color 0.2s;
}
.game-pick-btn:hover { border-color: var(--primary, #3b82f6); }
.game-pick-icon { font-size: 1.3rem; }
.game-pick-desc { font-size: 0.75rem; color: var(--text-muted); margin-left: auto; }

/* Game challenge in chat */
.game-challenge {
  display: flex; align-items: center; gap: 0.75rem;
  background: var(--bg-tertiary, #2a2a3e); border: 1px solid var(--primary, #3b82f6);
  border-radius: 8px; padding: 0.5rem 0.75rem; margin: 0.25rem 0;
}
.game-challenge-icon { font-size: 1.5rem; }
.game-status { color: var(--text-secondary); font-style: italic; }

/* Game overlay */
.game-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.7); z-index: 1000;
  display: flex; align-items: center; justify-content: center;
}
.game-modal {
  background: var(--bg-primary, #0f0f1a); border: 1px solid var(--border, #3a3a4e);
  border-radius: 12px; padding: 1.5rem; max-width: 90vw; max-height: 90vh; overflow: auto;
  position: relative;
}
.game-header { text-align: center; margin-bottom: 1rem; }
.game-header h2 { margin: 0; }
.game-players { margin-top: 0.5rem; font-size: 0.9rem; }
.game-player-active { color: var(--primary, #3b82f6); font-weight: 700; }
.game-player-me { text-decoration: underline; }
.game-turn { color: var(--primary); font-weight: 600; margin-top: 0.3rem; }
.game-result { color: var(--gold, #fbbf24); font-weight: 700; font-size: 1.2rem; margin-top: 0.3rem; }
.game-close {
  position: absolute; top: 0.75rem; right: 0.75rem;
  background: none; border: none; color: var(--text-muted); font-size: 1.5rem; cursor: pointer;
}
.game-close:hover { color: var(--text-primary); }

/* Piškvorky */
.piskvorky-board { display: inline-block; border: 1px solid var(--border); }
.piskvorky-row { display: flex; }
.piskvorky-cell {
  width: 28px; height: 28px; border: 1px solid var(--border, #2a2a3e);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.9rem; user-select: none;
}
.piskvorky-clickable { cursor: pointer; }
.piskvorky-clickable:hover { background: rgba(59, 130, 246, 0.15); }

/* Dáma */
.dama-board { display: inline-block; border: 2px solid var(--border); }
.dama-row { display: flex; }
.dama-cell {
  width: 48px; height: 48px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; user-select: none;
}
.dama-light { background: #d4a76a; }
.dama-dark { background: #8b5e3c; }
.dama-selectable { cursor: pointer; }
.dama-selectable:hover { outline: 2px solid var(--primary); outline-offset: -2px; }
.dama-selected { outline: 3px solid var(--gold, #fbbf24) !important; outline-offset: -3px; }
.dama-dark:not(.dama-selectable):not(.dama-selected) { cursor: pointer; }

/* Prší */
.prsi-table { text-align: center; min-width: 300px; }
.prsi-opponents { display: flex; justify-content: center; gap: 2rem; margin-bottom: 1rem; }
.prsi-opponent { background: var(--bg-secondary); border-radius: 6px; padding: 0.5rem 1rem; font-size: 0.85rem; }
.prsi-center { margin: 1rem 0; }
.prsi-top-card {
  display: inline-flex; flex-direction: column; align-items: center;
  background: var(--bg-secondary); border: 2px solid var(--border);
  border-radius: 8px; padding: 1rem 1.5rem; font-size: 1.5rem; min-width: 60px;
}
.prsi-card-value { font-weight: 700; }
.prsi-card-suit { font-size: 1.2rem; }
.prsi-info { margin-top: 0.5rem; font-size: 0.85rem; color: var(--text-secondary); }
.prsi-my-hand { display: flex; justify-content: center; align-items: center; gap: 0.5rem; margin-top: 1rem; flex-wrap: wrap; }
.prsi-card {
  display: flex; flex-direction: column; align-items: center;
  background: var(--bg-secondary); border: 2px solid var(--border);
  border-radius: 6px; padding: 0.5rem 0.75rem; min-width: 45px;
  font-size: 1.1rem; user-select: none; transition: transform 0.15s, border-color 0.15s;
}
.prsi-card-playable { cursor: pointer; }
.prsi-card-playable:hover { transform: translateY(-6px); border-color: var(--primary); }

/* Lodě */
.lode-boards { display: flex; gap: 2rem; justify-content: center; flex-wrap: wrap; }
.lode-grid { display: inline-block; border: 1px solid var(--border); }
.lode-row { display: flex; }
.lode-cell {
  width: 32px; height: 32px; border: 1px solid var(--border, #2a2a3e);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; user-select: none;
}
.lode-ship { background: #1e40af; color: #93c5fd; }
.lode-hit { background: #7f1d1d; color: #fca5a5; }
.lode-miss { background: var(--bg-tertiary); color: var(--text-muted); }
.lode-clickable { cursor: pointer; }
.lode-clickable:hover { background: rgba(59, 130, 246, 0.2); }
.lode-shot-cell { background: var(--bg-secondary); }

/* Pexeso */
.pexeso-scores { text-align: center; margin-bottom: 1rem; font-size: 0.9rem; }
.pexeso-grid {
  display: grid; gap: 6px; max-width: 420px; margin: 0 auto;
}
.pexeso-card {
  aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
  border-radius: 8px; font-size: 1.5rem; user-select: none;
  transition: transform 0.3s;
}
.pexeso-back {
  background: var(--primary, #3b82f6); color: #fff; font-size: 1.2rem; font-weight: 700;
}
.pexeso-face {
  background: var(--bg-secondary); border: 2px solid var(--border);
}
.pexeso-clickable { cursor: pointer; }
.pexeso-clickable:hover { transform: scale(1.08); }

/* Člověče nezlob se */
.clovece-game { text-align: center; }
.clovece-dice { margin: 1rem 0; }
.clovece-dice-face { font-size: 3rem; }
.clovece-roll { font-size: 1.2rem; padding: 0.75rem 2rem; }
.clovece-board { display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: center; margin-top: 1rem; }
.clovece-player {
  background: var(--bg-secondary); border: 1px solid var(--border);
  border-radius: 8px; padding: 0.75rem; min-width: 200px; text-align: left;
}
.clovece-me { border-color: var(--primary); }
.clovece-player-name { font-weight: 700; margin-bottom: 0.5rem; font-size: 1rem; }
.clovece-player-status { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.85rem; }
.clovece-player-status sub { font-size: 0.65rem; color: var(--text-muted); }
.clovece-actions { margin-top: 0.5rem; display: flex; flex-wrap: wrap; gap: 0.3rem; }

/* Comarr tabulka */
.comarr-table { font-size: 0.85rem; }
.comarr-table th { white-space: nowrap; }
.comarr-row td { border-top: 1px solid var(--border, #2a2a3e); }
.comarr-reasons-row td { border-top: 0; padding-top: 0 !important; padding-bottom: 0.4rem !important; }
.comarr-score-high { color: #34d399; font-size: 1rem; }
.comarr-score-mid { color: #fbbf24; font-size: 1rem; }
.comarr-score-low { color: #6b7280; font-size: 1rem; }

/* Comarr v Dispečerovi */
.dispatch-comarr { margin-top: 0.5rem; padding: 0.4rem; background: var(--bg-tertiary, #2a2a3e); border-radius: 4px; font-size: 0.8rem; }
.dispatch-comarr-title { color: var(--text-muted); margin-bottom: 0.3rem; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.05em; }
.dispatch-comarr-item { padding: 0.2rem 0; border-bottom: 1px dotted var(--border, #2a2a3e); }
.dispatch-comarr-item:last-child { border-bottom: 0; }

/* Compliance violation rows */
.compliance-violation { background: rgba(239, 68, 68, 0.06) !important; }
.compliance-violation td { border-color: rgba(239, 68, 68, 0.15) !important; }

/* Status badges for transport */
.status-badge.draft { background: var(--bg-tertiary, #374151); color: var(--text-secondary, #9ca3af); }
.status-badge.planned { background: #1e40af; color: #93c5fd; }
.status-badge.confirmed { background: #065f46; color: #6ee7b7; }
.status-badge.loading, .status-badge.unloading { background: #92400e; color: #fcd34d; }
.status-badge.in_transit { background: #1e3a5f; color: #7dd3fc; }
.status-badge.delivered { background: #064e3b; color: #34d399; }
.status-badge.invoiced { background: #312e81; color: #a5b4fc; }
.status-badge.cancelled { background: #7f1d1d; color: #fca5a5; }
.status-badge.active { background: #064e3b; color: #34d399; }
.status-badge.inactive { background: var(--bg-tertiary, #374151); color: var(--text-muted, #6b7280); }
.status-badge.vacation { background: #1e40af; color: #93c5fd; }
.status-badge.sick { background: #92400e; color: #fcd34d; }

/* Vehicle checkboxes & equipment */
.vehicle-checkboxes {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 0.75rem 0;
}
.vehicle-checkboxes label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
  cursor: pointer;
}
.vehicle-checkboxes input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary, #3b82f6);
}
.vehicle-equip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.equip-badge {
  background: var(--bg-tertiary, #2a2a3e);
  border: 1px solid var(--border, #3a3a4e);
  border-radius: 6px;
  padding: 0.35rem 0.75rem;
  font-size: 0.85rem;
}

/* Dispatch board */
.dispatch-header { margin-bottom: 1.5rem; }
.dispatch-grid { display: flex; flex-direction: column; gap: 1.5rem; }
.dispatch-card {
  background: var(--bg-secondary, #1e1e2e);
  border-radius: 8px;
  padding: 1rem;
  border-left: 4px solid var(--border, #3a3a4e);
}
.dispatch-card.dispatch-good { border-left-color: #34d399; }
.dispatch-card.dispatch-ok { border-left-color: #fbbf24; }
.dispatch-card.dispatch-empty { border-left-color: #6b7280; }
.dispatch-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border, #3a3a4e);
}
.dispatch-count {
  font-weight: 700;
  font-size: 1.1rem;
}
.dispatch-count.dispatch-good { color: #34d399; }
.dispatch-count.dispatch-ok { color: #fbbf24; }
.dispatch-count.dispatch-empty { color: #6b7280; }
.dispatch-table {
  width: 100%;
  font-size: 0.85rem;
  border-collapse: collapse;
}
.dispatch-table th {
  text-align: left;
  font-size: 0.75rem;
  color: var(--text-muted, #6b7280);
  padding: 0.3rem 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.dispatch-table td { padding: 0.4rem 0.5rem; }
.dispatch-table tbody tr { border-top: 1px solid var(--border, #2a2a3e); }
.dispatch-row-good { background: rgba(52, 211, 153, 0.05); }
.dispatch-row-ok { background: rgba(251, 191, 36, 0.04); }
.dispatch-row-fail { opacity: 0.5; }
.dispatch-semafor { font-size: 1.1rem; text-align: center; width: 2rem; }
.dispatch-confirm { padding: 0.2rem 0.6rem; font-size: 0.8rem; }

/* Loading bar */
.load-bar-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}
.load-bar {
  flex: 1;
  min-width: 120px;
  height: 12px;
  background: var(--bg-tertiary, #2a2a3e);
  border-radius: 6px;
  overflow: hidden;
}
.load-bar-fill {
  height: 100%;
  border-radius: 6px;
  transition: width 0.3s ease;
}
.load-bar-fill.load-full { background: #34d399; }
.load-bar-fill.load-good { background: #3b82f6; }
.load-bar-fill.load-partial { background: #fbbf24; }
.load-bar-fill.load-empty { background: #6b7280; }
.load-bar-text {
  font-size: 0.8rem;
  color: var(--text-secondary, #9ca3af);
  white-space: nowrap;
}

/* Schedule / Grafikon */
.schedule-grid {
  border: 1px solid var(--border, #3a3a4e);
  border-radius: 8px;
  overflow-x: auto;
}
.schedule-header, .schedule-row {
  display: grid;
  grid-template-columns: 160px repeat(7, 1fr);
  min-width: 800px;
}
.schedule-header {
  background: var(--bg-tertiary, #2a2a3e);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted, #6b7280);
}
.schedule-header > div, .schedule-row > div {
  padding: 0.5rem;
  border-right: 1px solid var(--border, #2a2a3e);
}
.schedule-row {
  border-top: 1px solid var(--border, #2a2a3e);
}
.schedule-row:hover { background: rgba(255,255,255,0.02); }
.schedule-vehicle-col {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  font-size: 0.85rem;
}
.schedule-vehicle-meta {
  font-size: 0.75rem;
  color: var(--text-muted, #6b7280);
}
.schedule-util {
  font-size: 0.7rem;
  font-weight: 700;
}
.util-high { color: #34d399; }
.util-mid { color: #fbbf24; }
.util-low { color: #6b7280; }
.schedule-cell { min-height: 48px; display: flex; flex-direction: column; gap: 2px; }
.schedule-block {
  border-radius: 4px;
  padding: 0.2rem 0.35rem;
  font-size: 0.75rem;
  color: #fff;
  cursor: default;
  line-height: 1.2;
}
.schedule-block-num { font-weight: 600; display: block; }
.schedule-block-route { font-size: 0.65rem; opacity: 0.8; display: block; }
.schedule-empty { min-height: 16px; }

/* Integration cards */
.integration-card { text-align: center; transition: border-color 0.2s; }
.integration-enabled { border-left: 3px solid #34d399; }
.integration-disabled { border-left: 3px solid var(--bg-tertiary, #374151); opacity: 0.7; }
.integration-status { display: flex; gap: 0.5rem; justify-content: center; margin-top: 0.75rem; }

/* Transport form spacing */
#vehicle-form .fin-form-row,
#driver-form .fin-form-row,
#order-form .fin-form-row {
  flex-wrap: wrap;
}

#vehicle-form .form-group,
#driver-form .form-group,
#order-form .form-group {
  min-width: 140px;
}

/* Settings */
.settings-section { margin-bottom: 1.5rem; }
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 0.75rem;
}
.settings-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.5rem 0.75rem;
  background: var(--bg-secondary, #1e1e2e);
  border-radius: 6px;
}
.settings-label {
  font-size: 0.75rem;
  color: var(--text-muted, #6b7280);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.settings-value {
  font-size: 0.95rem;
  color: var(--text-primary, #e5e5e5);
  font-weight: 500;
}
.settings-input {
  background: var(--bg-tertiary, #2a2a3e);
  border: 1px solid var(--border, #3a3a4e);
  color: var(--text-primary, #e5e5e5);
  border-radius: 4px;
  padding: 0.35rem 0.5rem;
  font-size: 0.9rem;
  width: 100%;
}
.settings-input:focus {
  border-color: var(--primary, #3b82f6);
  outline: none;
}
.role-select {
  background: var(--bg-tertiary, #2a2a3e);
  color: var(--text-primary, #e5e5e5);
  border: 1px solid var(--border, #3a3a4e);
  border-radius: 4px;
  padding: 0.3rem 0.4rem;
  font-size: 0.85rem;
}
.status-badge.biz-majitel { background: #7c3aed; color: #e9d5ff; }
.status-badge.biz-spravce { background: #1e40af; color: #93c5fd; }
.status-badge.biz-dispecer { background: #065f46; color: #6ee7b7; }
.status-badge.biz-ucetni { background: #92400e; color: #fcd34d; }
.status-badge.biz-ridic { background: #374151; color: #9ca3af; }
.status-badge.biz-skladnik { background: #374151; color: #9ca3af; }
.status-badge.biz-zamestnanec { background: #1f2937; color: #6b7280; }

/* ── Toast notifications ── */
.mv-toast {
  position: fixed;
  top: 20px;
  right: 20px;
  background: rgba(34, 197, 94, 0.95);
  color: #fff;
  padding: 0.7rem 1.2rem;
  border-radius: 6px;
  font-size: 0.9rem;
  font-family: var(--font-heading);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  z-index: 3000;
  opacity: 1;
  transition: opacity 0.35s, transform 0.35s;
  transform: translateX(0);
  pointer-events: none;
}
.mv-toast.mv-toast-err { background: rgba(239, 68, 68, 0.95); }
.mv-toast.mv-toast-warn { background: rgba(245, 158, 11, 0.95); }
.mv-toast.fade { opacity: 0; transform: translateX(20px); }

/* ── Vehicle load plan ── */
.load-plan-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.8rem;
  margin-bottom: 1rem;
}
/* veh-load-bar — vehicle load plan capacity bars (renamed to avoid clashing
   with the existing .load-bar in tachograph and Comarr views) */
.veh-load-bar {
  background: var(--bg-card);
  border: 1px solid rgba(201, 168, 76, 0.1);
  border-radius: 6px;
  padding: 0.6rem 0.8rem;
}
.veh-load-bar-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-family: var(--font-heading);
  letter-spacing: 0.05em;
  margin-bottom: 0.3rem;
}
.veh-load-bar-track {
  position: relative;
  height: 8px;
  background: rgba(255,255,255,0.05);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 0.3rem;
}
.veh-load-bar-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  background: var(--gold);
  border-radius: 4px;
  transition: width 0.35s ease;
}
.veh-load-bar-overflow {
  position: absolute;
  right: 4px;
  top: -12px;
  font-size: 0.65rem;
  color: #ef4444;
  font-weight: 700;
}
.veh-load-bar-detail {
  font-size: 0.75rem;
  color: var(--text-primary);
}
.veh-load-bar-detail strong { color: var(--gold); }

.load-plan-table { font-size: 0.85rem; }
.load-plan-table tr:hover { background: rgba(201, 168, 76, 0.05); }

/* ── Transfer history ── */
.transfer-row {
  padding: 0.65rem 0.8rem;
  margin-bottom: 0.4rem;
  background: rgba(80, 160, 240, 0.05);
  border-left: 3px solid #5fa8ff;
  border-radius: 0 6px 6px 0;
  font-size: 0.85rem;
}
.transfer-meta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-family: var(--font-heading);
  margin-bottom: 0.3rem;
}
.transfer-when { color: var(--gold); }
.transfer-where { color: #5fa8ff; }
.transfer-diff {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  color: var(--text-primary);
  font-size: 0.82rem;
}
.transfer-diff .lbl { color: var(--text-muted); font-size: 0.7rem; margin-right: 0.3rem; }
.transfer-arrow {
  color: #5fa8ff;
  font-weight: 700;
  margin: 0 0.3rem;
}
.transfer-diff strong { color: #22c55e; }
.transfer-reason {
  margin-top: 0.3rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-style: italic;
}

.rate-good { color: #22c55e; font-weight: 700; }
.rate-mid  { color: #eab308; font-weight: 600; }
.rate-low  { color: #ef4444; font-weight: 600; }


/* ── Pricing model 4-tier panel ── */
.rate-orange { color: #f97316; font-weight: 700; }

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
  margin-top: 0.5rem;
}
.price-cell {
  background: var(--bg-card);
  border: 1px solid rgba(201, 168, 76, 0.15);
  border-radius: 6px;
  padding: 0.7rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.price-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-family: var(--font-heading);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.price-main {
  font-size: 1.05rem;
  color: var(--text-primary);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
.price-sub {
  font-size: 0.7rem;
  color: var(--text-muted);
}
.price-inline-input {
  background: var(--bg-dark);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  font-size: 0.95rem;
  font-weight: 700;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  width: 100px;
  text-align: right;
  font-family: inherit;
}
.price-inline-input:focus { outline: 1px solid var(--gold); }
.price-cur { font-size: 0.75rem; color: var(--text-muted); font-weight: 400; }

.price-optimal { border-left: 3px solid #c9a84c; }
.price-offered { border-left: 3px solid #5fa8ff; }
.price-final { border-left: 3px solid #22c55e; }

.price-semafor {
  align-items: center;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.price-semafor.rate-good { border-color: rgba(34, 197, 94, 0.5); background: rgba(34, 197, 94, 0.06); }
.price-semafor.rate-mid { border-color: rgba(234, 179, 8, 0.5); background: rgba(234, 179, 8, 0.06); }
.price-semafor.rate-orange { border-color: rgba(249, 115, 22, 0.5); background: rgba(249, 115, 22, 0.06); }
.price-semafor.rate-low { border-color: rgba(239, 68, 68, 0.5); background: rgba(239, 68, 68, 0.06); }

/* ── Prominent rate panel (settings tab top) ── */
.rate-prominent {
  background: linear-gradient(135deg, rgba(201, 168, 76, 0.08), rgba(201, 168, 76, 0.02));
  border: 1px solid rgba(201, 168, 76, 0.3);
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
}
.rate-prominent .section-title { color: #c9a84c !important; }
.rate-prominent-box {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  background: var(--bg-dark);
  border: 1px solid rgba(201, 168, 76, 0.4);
  border-radius: 8px;
  padding: 0.6rem 1rem;
  max-width: 320px;
}
.rate-prominent-input {
  background: transparent;
  border: 0;
  color: #c9a84c;
  font-size: 2rem;
  font-weight: 700;
  font-family: var(--font-heading);
  width: 140px;
  text-align: right;
  outline: none;
}
.rate-prominent-input:focus { color: #ece2d0; }
.rate-prominent-input::-webkit-outer-spin-button,
.rate-prominent-input::-webkit-inner-spin-button { opacity: 1; }
.rate-prominent-unit {
  color: var(--text-muted);
  font-size: 1rem;
  font-family: var(--font-heading);
  letter-spacing: 0.05em;
}

/* ── Comarr expandable detail rows ── */
.comarr-detail-row { display: none; }
.comarr-detail-row:not(.comarr-detail-hidden) { display: table-row; }
.comarr-detail-hidden { display: none !important; }
/* Golden accent linking row <-> detail */
.comarr-row-expanded {
  background: rgba(212, 165, 72, 0.08) !important;
  box-shadow: inset 4px 0 0 var(--gold, #d4a548);
}
.comarr-row-expanded td:first-child { border-left: 4px solid var(--gold, #d4a548); padding-left: calc(0.75rem - 4px) !important; }
.comarr-detail-row td { border-left: 4px solid var(--gold, #d4a548) !important; border-bottom: 2px solid var(--gold, #d4a548); background: rgba(212, 165, 72, 0.04) !important; }
.comarr-row { transition: background 0.15s ease; }
.comarr-row:hover { background: rgba(212, 165, 72, 0.04) !important; }
.comarr-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.4rem 1rem;
  font-size: 0.82rem;
}
.comarr-detail-grid .lbl {
  color: var(--text-muted);
  font-size: 0.7rem;
  margin-right: 0.3rem;
}
.comarr-tag {
  display: inline-block;
  background: rgba(201, 168, 76, 0.15);
  color: var(--gold);
  padding: 0.1rem 0.4rem;
  border-radius: 8px;
  font-size: 0.7rem;
  margin-right: 0.2rem;
}

/* ── Vehicle activity badges ── */
.activity-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.5rem;
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.activity-badge.idle { background: rgba(138,130,120,0.15); color: var(--text-muted); }
.activity-badge.planned { background: rgba(80,160,240,0.15); color: #5fa8ff; }
.activity-badge.confirmed { background: rgba(34,197,94,0.15); color: #22c55e; }
.activity-badge.loading { background: rgba(245,158,11,0.2); color: #f59e0b; }
.activity-badge.transit { background: rgba(99,102,241,0.2); color: #818cf8; animation: transit-pulse 2s ease-in-out infinite; }
.activity-badge.unloading { background: rgba(236,72,153,0.15); color: #ec4899; }
@keyframes transit-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0.3); }
  50%      { box-shadow: 0 0 0 4px rgba(99,102,241,0); }
}

/* ── Comarr return badge ── */
.return-badge { font-size: 0.85rem; }
.comarr-return { border-left: 3px solid #22c55e !important; }
.comarr-return td:first-child { position: relative; }

/* Geocode autocomplete */
.mv-ac-suggestions {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg-card, #1a1410);
  border: 1px solid var(--gold, #d4a548);
  border-top: none;
  z-index: 1000;
  max-height: 280px;
  overflow-y: auto;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}
.mv-ac-item {
  padding: 8px 10px;
  cursor: pointer;
  font-size: 0.88rem;
  color: var(--text, #ece2d0);
  border-bottom: 1px solid rgba(212, 165, 72, 0.15);
}
.mv-ac-item:hover { background: rgba(212, 165, 72, 0.12); }
.mv-ac-cc {
  display: inline-block;
  min-width: 28px;
  padding: 1px 5px;
  background: var(--gold, #d4a548);
  color: #1a1410;
  font-weight: bold;
  font-size: 0.75rem;
  border-radius: 3px;
  margin-right: 6px;
}
