@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Playfair+Display:ital,wght@0,400;0,500;0,600;0,700;1,400&display=swap');

:root {
  color-scheme: dark;
  
  /* Luxury Premium Dark Theme Palette */
  --bg-canvas: #07080a;
  --bg-sidebar: rgba(10, 11, 14, 0.85);
  --bg-card: rgba(16, 18, 22, 0.65);
  --bg-card-hover: rgba(24, 27, 33, 0.85);
  --bg-input: rgba(4, 5, 6, 0.45);
  
  /* Brand champagne & gold tones */
  --champagne: #d7b56d;
  --champagne-light: #e6ce9e;
  --champagne-glow: rgba(215, 181, 109, 0.15);
  --gold-gradient: linear-gradient(135deg, #d7b56d 0%, #b8934b 100%);
  
  /* Text scales */
  --ink: #f4efe6;
  --muted: #a69a8b;
  --soft: rgba(244, 239, 230, 0.8);
  
  /* Subtle borders and divider lines */
  --line: rgba(215, 181, 109, 0.08);
  --line-strong: rgba(215, 181, 109, 0.18);
  --line-focus: rgba(215, 181, 109, 0.45);
  
  /* Status Indicators (Soft premium desaturated versions) */
  --status-inquiry: #b2c9e4;      /* Soft powder blue */
  --status-quote: #e6ce9e;        /* Pale gold */
  --status-deposit: #e5b3a3;      /* Soft terracotta */
  --status-confirmed: #9ac9ab;    /* Sage green */
  --status-out: #dfd79b;          /* Soft mustard yellow */
  --status-returned: #a8d5db;     /* Soft teal */
  --status-closed: #9a9ea6;       /* Neutral slate */
  --status-canceled: #e2a8a8;     /* Faded rose red */

  /* Shadows */
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 12px 28px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.6);
  --shadow-gold: 0 8px 24px rgba(215, 181, 109, 0.08);

  /* Font Systems */
  --font-serif: "Playfair Display", Georgia, serif;
  --font-sans: "Outfit", ui-sans-serif, system-ui, -apple-system, sans-serif;
}

/* Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  background-color: var(--bg-canvas);
}

body {
  min-width: 320px;
  color: var(--ink);
  font-family: var(--font-sans);
  background:
    linear-gradient(rgba(7, 8, 10, 0.82), rgba(7, 8, 10, 0.96)),
    url("https://images.unsplash.com/photo-1464366400600-7168b8af9bc3?auto=format&fit=crop&w=2200&q=82")
      center top / cover fixed,
    var(--bg-canvas);
  min-height: 100vh;
  letter-spacing: -0.01em;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: rgba(7, 8, 10, 0.6);
}
::-webkit-scrollbar-thumb {
  background: rgba(215, 181, 109, 0.2);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(215, 181, 109, 0.4);
}

/* Layout Framework */
.studio-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

/* Sidebar Navigation */
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 32px 24px;
  border-right: 1px solid var(--line);
  background: var(--bg-sidebar);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  z-index: 100;
}

.brand {
  display: flex;
  gap: 14px;
  align-items: center;
  text-decoration: none;
  color: var(--ink);
}

.brand-mark {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 1px solid rgba(215, 181, 109, 0.35);
  border-radius: 12px;
  color: var(--champagne);
  background: rgba(215, 181, 109, 0.08);
  font-family: var(--font-serif);
  font-size: 26px;
  font-weight: 500;
  box-shadow: inset 0 0 10px rgba(215, 181, 109, 0.1);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.brand:hover .brand-mark {
  border-color: var(--champagne);
  background: rgba(215, 181, 109, 0.15);
  box-shadow: 0 0 15px rgba(215, 181, 109, 0.25);
  transform: scale(1.03);
}

.brand strong {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.brand small {
  display: block;
  font-family: var(--font-sans);
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 500;
  margin-top: 2px;
}

.nav {
  display: grid;
  gap: 6px;
  margin: 40px 0;
}

.nav a {
  padding: 12px 16px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--soft);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav a:hover,
.nav a:focus {
  border-color: var(--line-strong);
  color: var(--champagne);
  background: rgba(215, 181, 109, 0.06);
  outline: none;
  transform: translateX(4px);
}

/* Active Nav State - matching location hash */
.nav a[href="#dashboard"]:active,
.nav a:hover {
  text-shadow: 0 0 8px rgba(215, 181, 109, 0.15);
}

.side-panel {
  display: grid;
  gap: 8px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(215, 181, 109, 0.02);
}

.side-panel a {
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s ease;
  background: rgba(0, 0, 0, 0.15);
}

.side-panel a:hover,
.side-panel a:focus {
  border-color: var(--champagne);
  color: var(--ink);
  background: rgba(215, 181, 109, 0.05);
  outline: none;
}

.eyebrow {
  color: var(--champagne);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  display: block;
}

/* Main Dashboard Panel */
.main {
  display: grid;
  align-content: start; /* Phase 178 — don't stretch rows to fill 100vh; that
      ballooned the tab strip to ~220px on short mobile sections (huge empty gap). */
  gap: 24px;
  width: min(1600px, 100%);
  padding: 32px;
  margin: 0 auto;
}

/* Sections Framework */
.hero-band,
.section-band {
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  overflow: hidden;
}

/* Custom Header Band */
.hero-band {
  display: grid;
  grid-template-columns: 1fr minmax(320px, 560px);
  gap: 36px;
  align-items: end;
  min-height: 380px;
  padding: 48px;
  background:
    linear-gradient(135deg, rgba(7, 8, 10, 0.45), rgba(7, 8, 10, 0.95)),
    url("https://images.unsplash.com/photo-1519225421980-715cb0215aed?auto=format&fit=crop&w=1800&q=82")
      center / cover;
  border: 1px solid var(--line-strong);
  position: relative;
}

.hero-band::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 250px;
  height: 250px;
  background: radial-gradient(circle, rgba(215, 181, 109, 0.08) 0%, transparent 70%);
  pointer-events: none;
}

.hero-copy h1 {
  max-width: 800px;
  margin: 14px 0 18px;
  font-family: var(--font-serif);
  font-size: clamp(34px, 5.5vw, 68px);
  font-weight: 500;
  line-height: 1.05;
  color: var(--ink);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

.hero-copy p {
  max-width: 600px;
  color: var(--soft);
  font-size: clamp(15px, 1.8vw, 17px);
  line-height: 1.6;
}

/* Metric Widgets */
.metric-grid,
.report-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.metric,
.report-card {
  min-height: 120px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(10, 12, 16, 0.82);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.03);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.metric:hover,
.report-card:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-sm), var(--shadow-gold);
}

.metric span,
.report-card span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.metric strong,
.report-card strong {
  display: block;
  margin-top: 12px;
  color: var(--ink);
  font-size: clamp(24px, 2.5vw, 36px);
  font-family: var(--font-serif);
  font-weight: 600;
  letter-spacing: -0.01em;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

#metricRevenue, 
#metricOrders, 
#metricItemsOut, 
#metricUnpaid {
  color: var(--champagne-light);
  text-shadow: 0 0 12px rgba(215, 181, 109, 0.12);
}

/* Dashboard Section Band */
.section-band {
  padding: 36px;
  background: var(--bg-card);
}

.section-heading {
  display: flex;
  gap: 20px;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 18px;
}

.section-heading h2 {
  font-family: var(--font-serif);
  margin-top: 8px;
  font-size: clamp(24px, 3.2vw, 34px);
  font-weight: 500;
  color: var(--ink);
}

/* Splits (Layout for side-by-side forms and columns) */
.split-layout {
  display: grid;
  grid-template-columns: minmax(320px, 440px) 1fr;
  gap: 28px;
  align-items: start;
}

/* Cards & Panels Grid */
.panel,
.inventory-card,
.timeline-item,
.order-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(11, 13, 17, 0.78);
  box-shadow: var(--shadow-sm);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.panel:hover {
  border-color: var(--line-strong);
}

.form-panel,
.panel {
  padding: 24px;
}

.panel h3 {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 18px;
  color: var(--champagne-light);
}

/* Forms & Fields Styles */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--soft);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.search-field {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--soft);
  font-size: 13px;
  font-weight: 600;
}

.search-field input {
  min-width: 250px;
}

input,
select,
textarea {
  width: 100%;
  min-height: 46px;
  padding: 12px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  color: var(--ink);
  background: var(--bg-input);
  outline: none;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 400;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

textarea {
  resize: vertical;
  min-height: 100px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--line-focus);
  box-shadow: 
    0 0 0 3px rgba(215, 181, 109, 0.12),
    inset 0 1px 3px rgba(0, 0, 0, 0.4);
  background: rgba(10, 12, 16, 0.95);
}

/* Select element customization - custom chevron arrow */
select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23d7b56d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 16px;
  padding-right: 44px;
  cursor: pointer;
}

/* Action Rows & Custom Premium Buttons */
.action-row,
.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-top: 18px;
}

.primary-button,
.ghost-button,
.card-actions button,
.quick-notes button,
.order-actions button {
  min-height: 44px;
  padding: 12px 20px;
  border-radius: 10px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.primary-button {
  border: 1px solid var(--champagne);
  color: #0b0702;
  background: var(--gold-gradient);
  box-shadow: 0 4px 15px rgba(215, 181, 109, 0.2);
}

.primary-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(215, 181, 109, 0.35);
  filter: brightness(1.08);
}

.primary-button:active {
  transform: translateY(0);
}

.ghost-button,
.card-actions button,
.quick-notes button,
.order-actions button {
  border: 1px solid var(--line-strong);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.04);
}

.ghost-button:hover,
.card-actions button:hover,
.quick-notes button:hover,
.order-actions button:hover {
  border-color: var(--champagne);
  color: var(--champagne);
  background: rgba(215, 181, 109, 0.06);
  transform: translateY(-2px);
  box-shadow: var(--shadow-gold);
}

.ghost-button:active,
.card-actions button:active,
.quick-notes button:active,
.order-actions button:active {
  transform: translateY(0);
}

/* Inventory Gallery & Cards */
.inventory-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.inventory-card {
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.inventory-card:hover {
  transform: translateY(-4px);
  border-color: var(--line-focus);
  background: var(--bg-card-hover);
  box-shadow: var(--shadow-md), var(--shadow-gold);
}

.inventory-card img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #0f1116;
  border-bottom: 1px solid var(--line);
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.inventory-card:hover img {
  transform: scale(1.04);
}

.inventory-card-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.card-title-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 8px;
}

.card-title-row h3 {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.25;
}

.price {
  font-family: var(--font-serif);
  color: var(--champagne);
  font-size: 18px;
  font-weight: 600;
}

.stock-row {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.chip,
.stock-pill {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border: 1px solid rgba(215, 181, 109, 0.15);
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.chip {
  color: var(--champagne);
  background: rgba(215, 181, 109, 0.08);
}

.stock-pill {
  color: var(--status-confirmed);
  border-color: rgba(154, 201, 171, 0.2);
  background: rgba(154, 201, 171, 0.08);
}

.stock-pill.warning {
  color: var(--status-canceled);
  border-color: rgba(226, 168, 168, 0.25);
  background: rgba(226, 168, 168, 0.08);
  animation: pulse-border 2s infinite ease-in-out;
}

.muted {
  color: var(--muted);
  font-size: 12px;
}

.deposit {
  font-size: 12px;
  font-weight: 500;
}

.item-notes {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  min-height: 58px;
  margin-top: 12px;
  border-top: 1px dashed var(--line);
  padding-top: 12px;
}

.inventory-card .card-actions {
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

/* Custom mini action buttons inside cards */
.card-actions button {
  min-height: 36px;
  padding: 8px 12px;
  font-size: 11px;
}

.card-actions button[data-action="dec"],
.card-actions button[data-action="inc"] {
  min-width: 36px;
  padding: 8px 0;
  font-size: 14px;
}

/* Timeline & Active Orders list */
.timeline,
.orders-list {
  display: grid;
  gap: 16px;
}

.timeline-item,
.order-card {
  display: grid;
  grid-template-columns: 180px 1fr auto;
  gap: 24px;
  align-items: center;
  padding: 24px;
}

/* Deep-link arrival highlight: a card opened via #order=<id> flashes gold so
   Diana instantly sees which order the notification link landed on. */
.order-card.order-flash { animation: order-flash 3.2s ease-out; }
@keyframes order-flash {
  0%, 12% { box-shadow: 0 0 0 3px #c8a24b, 0 8px 28px rgba(200, 162, 75, 0.45); }
  100%    { box-shadow: 0 0 0 0 rgba(200, 162, 75, 0); }
}

.timeline-item:hover,
.order-card:hover {
  border-color: var(--line-strong);
  background: var(--bg-card-hover);
  transform: translateX(4px);
}

.timeline-date {
  font-family: var(--font-serif);
  color: var(--champagne);
  font-size: 17px;
  font-weight: 500;
  letter-spacing: 0.02em;
  border-left: 2px solid var(--champagne);
  padding-left: 14px;
}

.timeline-item h3,
.order-card h3 {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--ink);
}

.timeline-item p,
.order-card p {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 4px;
}

.timeline-item p:last-child,
.order-card p:last-child {
  margin-bottom: 0;
}

/* Unique Invoice styling inside order titles */
.order-card h3 .muted {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  padding: 3px 8px;
  border-radius: 6px;
  margin-left: 10px;
  vertical-align: middle;
}

/* Beautiful custom status dropdowns and indicators */
.status-pill {
  display: inline-flex;
  min-width: 125px;
  justify-content: center;
  align-items: center;
  padding: 8px 16px;
  border: 1px solid transparent;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.08);
}

/* Dynamic status backgrounds on lists based on text content (handled via script status color mapping or fallback colors in CSS) */
.timeline-item:nth-child(even) .status-pill {
  color: var(--status-confirmed);
  border-color: rgba(154, 201, 171, 0.2);
  background: rgba(154, 201, 171, 0.08);
}

.timeline-item:nth-child(odd) .status-pill {
  color: var(--status-quote);
  border-color: rgba(230, 206, 158, 0.2);
  background: rgba(230, 206, 158, 0.08);
}

.order-card select[data-action="status"] {
  min-width: 160px;
  font-weight: 600;
  border-color: rgba(215, 181, 109, 0.25);
  color: var(--champagne);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.order-card select[data-action="status"]:hover {
  border-color: var(--champagne);
  background-color: rgba(215, 181, 109, 0.05);
}

.order-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
  border-top: 1px dashed var(--line);
  padding-top: 14px;
}

.order-actions button {
  min-height: 38px;
  padding: 8px 14px;
  font-size: 11px;
}

/* Invoices Template Grid */
.message-grid {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 24px;
}

.quick-notes {
  display: grid;
  gap: 8px;
  align-content: start;
}

.quick-notes h3 {
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 12px;
}

.quick-notes button {
  width: 100%;
  text-align: left;
  justify-content: flex-start;
  font-weight: 600;
  padding-left: 16px;
}

/* Form workflow status elements */
.form-status {
  min-height: 22px;
  margin-top: 12px;
  color: var(--champagne);
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
}

.empty-state {
  padding: 40px 20px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  font-size: 14px;
  background: rgba(215, 181, 109, 0.01);
}

/* Keyframes Animations */
@keyframes pulse-border {
  0% {
    box-shadow: 0 0 0 0 rgba(226, 168, 168, 0.4);
  }
  70% {
    box-shadow: 0 0 0 6px rgba(226, 168, 168, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(226, 168, 168, 0);
  }
}

/* Responsiveness Media Queries */
@media (max-width: 1200px) {
  .studio-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: sticky;
    top: 0;
    height: auto;
    flex-direction: row;
    align-items: center;
    padding: 18px 24px;
    border-right: none;
    border-bottom: 1px solid var(--line);
    background: rgba(10, 11, 14, 0.95);
  }

  .nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
  }

  .nav a {
    padding: 10px 14px;
    font-size: 13px;
  }

  .nav a:hover,
  .nav a:focus {
    transform: none;
  }

  .side-panel {
    display: none; /* Hide internal tools panel to save space on mobile/tablet navigation bar */
  }

  .hero-band {
    grid-template-columns: 1fr;
    min-height: auto;
    padding: 36px;
  }

  .split-layout,
  .message-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .main {
    padding: 16px;
    gap: 16px;
  }

  .sidebar {
    display: none !important; /* Hide sidebar completely in mobile, replaced by bottom-nav */
  }

  .mobile-topbar {
    display: flex !important; /* Show exit-to-hub bar on mobile */
  }

  body {
    padding-bottom: 80px; /* Space for bottom-nav */
  }

  .bottom-nav {
    display: flex !important; /* Show bottom navigation bar */
  }

  .brand {
    justify-content: center;
  }

  .nav {
    justify-content: center;
  }

  .hero-band {
    padding: 24px;
    text-align: center;
  }

  .hero-band::before {
    display: none;
  }

  .hero-copy h1 {
    margin-top: 8px;
  }

  .hero-copy p {
    margin: 0 auto;
  }

  .metric-grid,
  .report-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .section-band {
    padding: 20px;
  }

  .section-heading {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    padding-bottom: 14px;
    margin-bottom: 20px;
  }

  .section-heading div {
    text-align: left;
  }

  .search-field {
    flex-direction: column;
    align-items: stretch;
  }

  .search-field input {
    min-width: unset;
  }

  .timeline-item,
  .order-card {
    grid-template-columns: 1fr;
    gap: 16px;
    align-items: stretch;
    padding: 18px;
  }

  .timeline-item:hover,
  .order-card:hover {
    transform: none;
  }

  .timeline-date {
    border-left: none;
    border-bottom: 2px solid var(--champagne);
    padding-left: 0;
    padding-bottom: 8px;
  }

  .order-card select[data-action="status"] {
    width: 100%;
  }
}

/* Мобильная шапка с кнопкой выхода в хаб */
.mobile-topbar {
  display: none; /* Скрыта на десктопе, видна только на мобильном */
  align-items: center;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 9000;
  background: #fbf8f3;
  border-bottom: 1px solid rgba(197, 160, 89, 0.28);
  padding: 8px 14px;
  min-height: 54px;
}
.mobile-topbar .nav-back {
  text-decoration: none;
  font-size: 16px;
  font-weight: 600;
  color: #c5a059;
  padding: 8px 12px 8px 6px;
  min-height: 44px;
  display: flex;
  align-items: center;
  white-space: nowrap;
}
.mobile-topbar .nav-back:active {
  opacity: 0.6;
}
.mobile-topbar strong {
  font-size: 15px;
  font-weight: 600;
  color: #2a2520;
}

/* Bottom Navigation Bar */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 68px;
  background: rgba(10, 11, 14, 0.85);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border-top: 1px solid var(--line);
  display: none; /* Hidden by default on desktop */
  justify-content: space-around;
  align-items: center;
  z-index: 9999;
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.5);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.bottom-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--muted);
  text-decoration: none;
  font-size: 10px;
  font-weight: 500;
  flex: 1;
  height: 100%;
  transition: all 0.2s ease;
}

.bottom-nav a svg {
  color: var(--muted);
  transition: all 0.2s ease;
}

.bottom-nav a.active,
.bottom-nav a:hover {
  color: var(--champagne);
}

.bottom-nav a.active svg,
.bottom-nav a:hover svg {
  color: var(--champagne);
  transform: translateY(-2px);
  filter: drop-shadow(0 0 4px var(--champagne));
}

/* Floating AI Trigger Button */
.ai-trigger-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9998;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  /* Phase 195 — «жидкое стекло»: почти прозрачная, матовое размытие, видно что под ней. */
  background: rgba(255, 255, 255, 0.10);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.30);
  border-radius: 30px;
  color: var(--champagne, #d7b56d);
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.40);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.30);
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.ai-trigger-btn:hover {
  transform: translateY(-3px) scale(1.04);
  background: rgba(255, 255, 255, 0.18);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.50);
}

/* When a full-screen modal (e.g. manual order form) is open, keep the floating
   AI button + bottom-nav out of the way so they never overlap the form. */
body.modal-open .ai-trigger-btn,
body.modal-open .ai-widget-container,
body.modal-open .bottom-nav { display: none !important; }

.ai-sparkle {
  font-size: 16px;
  animation: spinSparkle 4s infinite linear;
}

/* AI Widget Container */
.ai-widget-container {
  position: fixed;
  bottom: 84px;
  right: 24px;
  width: 380px;
  height: 520px;
  max-height: calc(100vh - 180px);
  background: rgba(16, 18, 22, 0.88);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  z-index: 9997;
  box-shadow: var(--shadow-lg), 0 0 30px rgba(215, 181, 109, 0.08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: slideInUp 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Phase 185 — formed order list (grouped by section, editable rows). */
.mo-ol-row { display: flex; align-items: center; gap: 8px; padding: 5px 0; border-bottom: 1px solid var(--line-light, rgba(255,255,255,0.06)); }
.mo-ol-name { flex: 1; min-width: 0; font-size: 13px; }
.mo-ol-ctrls { display: flex; align-items: center; gap: 4px; flex: 0 0 auto; font-size: 12px; color: var(--muted); }
.mo-ol-qty { width: 44px; text-align: center; padding: 5px 4px; border: 1px solid var(--line); border-radius: 6px; -moz-appearance: textfield; font-size: 14px; }
.mo-ol-price { width: 56px; text-align: right; padding: 5px 6px; border: 1px solid var(--line); border-radius: 6px; -moz-appearance: textfield; font-size: 14px; }
.mo-ol-qty::-webkit-outer-spin-button, .mo-ol-qty::-webkit-inner-spin-button, .mo-ol-price::-webkit-outer-spin-button, .mo-ol-price::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.mo-ol-del { width: 30px; height: 30px; border-radius: 8px; color: #e5848a; }

/* Phase 178/182 — order item picker: photo + RU name + price + stepper. */
.mo-group { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--champagne); padding: 8px 0 4px; position: sticky; top: 0; background: var(--bg-card, #15171c); z-index: 1; }
.mo-thumb { width: 46px; height: 46px; object-fit: cover; border-radius: 8px; background: #22262e; flex: 0 0 auto; }
.mo-item-mid { flex: 1; min-width: 0; }
.mo-item-name { font-size: 13px; line-height: 1.25; }
.mo-item-sub { font-size: 11px; color: var(--muted); margin-top: 2px; display: flex; align-items: center; gap: 4px; }
.mo-price { width: 56px; text-align: right; padding: 3px 6px; font-size: 13px; border: 1px solid var(--line); border-radius: 6px; -moz-appearance: textfield; }
.mo-price::-webkit-outer-spin-button, .mo-price::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.mo-item { display: flex; align-items: center; gap: 8px; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid var(--line-light, rgba(255,255,255,0.06)); }
.mo-item.mo-on { background: rgba(215, 181, 109, 0.12); }
.mo-item-name { font-size: 13px; flex: 1; min-width: 0; }
.mo-item-name small { color: var(--muted); font-size: 11px; }
.mo-stepper { display: flex; align-items: center; flex: 0 0 auto; }
.mo-stepper input { width: 40px; text-align: center; padding: 6px 2px; border: 1px solid var(--line); border-left: 0; border-right: 0; border-radius: 0; -moz-appearance: textfield; font-size: 15px; }
.mo-stepper input::-webkit-outer-spin-button, .mo-stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.mo-step { width: 36px; height: 36px; border: 1px solid var(--line); background: var(--bg-card, #15171c); font-size: 19px; line-height: 1; cursor: pointer; color: var(--ink); display: flex; align-items: center; justify-content: center; }
.mo-step[data-mo-dec] { border-radius: 9px 0 0 9px; }
.mo-step[data-mo-inc] { border-radius: 0 9px 9px 0; }

/* Phase 177 — compact creation/edit forms on phone (usability > design):
   tighter labels (no uppercase spread), smaller gaps, 16px inputs so iOS
   doesn't zoom on focus. Scoped to the order + client forms only. */
.fg-full { grid-column: 1 / -1; }
/* Phase 184 — compact client-card action buttons (all widths). */
.client-card .action-row { gap: 6px; flex-wrap: wrap; }
.client-card .action-row button { padding: 6px 10px; font-size: 12px; min-height: 0; }
.client-card .action-row .cf-del { color: #e5848a; }
@media (max-width: 640px) {
  /* Keep these forms 2 columns on phone so short fields (dates, method+distance,
     name+phone) pair on one line instead of stacking. .fg-full spans both. */
  #manualOrderModal .form-grid,
  #clientCreateWrap .form-grid,
  .client-card .form-grid { gap: 8px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #manualOrderModal label,
  #clientCreateWrap label,
  .client-card label { gap: 3px; margin-bottom: 6px; font-size: 11px; text-transform: none; letter-spacing: 0; }
  #manualOrderModal input,
  #manualOrderModal select,
  #manualOrderModal textarea,
  #clientCreateWrap input,
  #clientCreateWrap textarea,
  .client-card input,
  .client-card textarea { padding: 8px 10px; font-size: 16px; }
  #manualOrderModal .action-row,
  #clientCreateWrap .action-row,
  .client-card .action-row { gap: 6px; }
  #moItemsBox { max-height: 200px; padding: 8px; }
  #manualOrderModal > div { padding-left: 12px; padding-right: 12px; }
}

@media (max-width: 480px) {
  .ai-widget-container {
    width: calc(100vw - 32px);
    right: 16px;
    bottom: 84px;
    height: 480px;
  }
  .ai-trigger-btn {
    bottom: 84px; /* Move above bottom-nav when chat is closed */
  }
  .ai-widget-container {
    bottom: 148px; /* Move above trigger when open on small screens */
  }
}

/* Header */
.ai-widget-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(10, 11, 14, 0.5);
}

.ai-header-title {
  display: flex;
  flex-direction: column;
  position: relative;
  padding-left: 14px;
}

.ai-pulse-dot {
  position: absolute;
  left: 0;
  top: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #9ac9ab;
  box-shadow: 0 0 8px #9ac9ab;
  animation: breatheDot 2s infinite ease-in-out;
}

.ai-header-title strong {
  font-family: var(--font-serif);
  color: var(--champagne);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.ai-header-title small {
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.ai-close-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 24px;
  cursor: pointer;
  transition: color 0.2s;
  line-height: 1;
}

.ai-close-btn:hover {
  color: var(--ink);
}

/* Tabs */
.ai-widget-tabs {
  display: flex;
  border-bottom: 1px solid var(--line);
  background: rgba(4, 5, 6, 0.25);
}

.ai-tab-btn {
  flex: 1;
  padding: 12px 8px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s;
}

.ai-tab-btn.active {
  color: var(--champagne);
  border-bottom-color: var(--champagne);
  background: rgba(215, 181, 109, 0.02);
}

.ai-tab-btn:hover {
  color: var(--ink);
}

/* Tab Content */
.ai-tab-content {
  flex: 1;
  display: none;
  flex-direction: column;
  overflow: hidden;
}

.ai-tab-content.active {
  display: flex;
}

/* Chat Messages */
.ai-chat-messages {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ai-message {
  max-width: 85%;
  padding: 12px 14px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.5;
}

.ai-message.assistant {
  align-self: flex-start;
  background: rgba(24, 27, 33, 0.6);
  border: 1px solid var(--line);
  color: var(--ink);
  border-top-left-radius: 2px;
}

.ai-message.user {
  align-self: flex-end;
  background: var(--gold-gradient);
  color: #07080a;
  font-weight: 500;
  border-top-right-radius: 2px;
  box-shadow: 0 4px 12px rgba(215, 181, 109, 0.1);
}

.ai-message.system {
  align-self: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--muted);
  font-size: 11px;
  padding: 6px 12px;
  border-radius: 20px;
}

.ai-message ul {
  margin-top: 6px;
  padding-left: 16px;
}

.ai-message li {
  margin-bottom: 4px;
}

/* Input Form */
.ai-input-form {
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  background: rgba(10, 11, 14, 0.4);
  display: flex;
  gap: 8px;
}

.ai-input-form input {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  padding: 10px 16px;
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 13px;
  transition: all 0.2s;
}

.ai-input-form input:focus {
  outline: none;
  border-color: var(--champagne);
  box-shadow: 0 0 8px var(--champagne-glow);
}

.ai-send-btn {
  background: var(--gold-gradient);
  border: none;
  border-radius: 20px;
  color: #07080a;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 12px;
  padding: 0 16px;
  cursor: pointer;
  transition: transform 0.2s;
}

.ai-send-btn:hover {
  transform: scale(1.03);
}

/* Translator Tab */
.ai-translator-box {
  flex: 1;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
}

.translator-direction-toggle {
  display: flex;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.toggle-option {
  flex: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toggle-option input {
  display: none;
}

.toggle-option span {
  display: block;
  width: 100%;
  padding: 10px 6px;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  transition: all 0.2s;
}

.toggle-option input:checked + span {
  background: rgba(215, 181, 109, 0.12);
  color: var(--champagne);
}

.translator-fields {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.translator-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.translator-field label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.translator-field textarea {
  background: var(--bg-input);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 10px;
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 13px;
  resize: none;
  transition: all 0.2s;
}

.translator-field textarea:focus {
  outline: none;
  border-color: var(--champagne);
  box-shadow: 0 0 8px var(--champagne-glow);
}

.trans-actions-row {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.trans-actions-row button {
  flex: 1;
  padding: 8px 10px;
  font-size: 11px;
}

/* Keyframes */
@keyframes pulseGlow {
  0%, 100% {
    box-shadow: 0 8px 24px rgba(215, 181, 109, 0.3), 0 0 0 0 rgba(215, 181, 109, 0.2);
  }
  50% {
    box-shadow: 0 8px 30px rgba(215, 181, 109, 0.5), 0 0 0 8px rgba(215, 181, 109, 0);
  }
}

@keyframes spinSparkle {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes breatheDot {
  0%, 100% { opacity: 0.5; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.1); }
}

@keyframes slideInUp {
  from { transform: translateY(30px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Luxury Login Overlay */
.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  background: rgba(4, 5, 7, 0.88);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  padding: 24px;
  animation: fadeIn 0.4s ease-out;
}

.login-card {
  width: 100%;
  max-width: 380px;
  background: rgba(16, 18, 22, 0.95);
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  padding: 42px 32px;
  text-align: center;
  box-shadow: var(--shadow-lg), var(--shadow-gold);
  animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.login-card .brand-mark {
  margin: 0 auto 24px;
}

.login-card h2 {
  font-family: var(--font-serif);
  font-size: 26px;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--ink);
}

.login-card p {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 24px;
}

.login-card form {
  display: grid;
  gap: 16px;
}

.login-card input {
  text-align: center;
  font-size: 16px;
  letter-spacing: 0.12em;
}

.login-error {
  margin-top: 14px;
  color: var(--status-canceled);
  font-size: 13px;
  min-height: 20px;
  font-weight: 600;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ==========================================================================
   MARKETING PANEL & AI AGENT UX STYLES (Obsidian Luxury Dark)
   ========================================================================== */

.agent-status-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  padding: 6px 14px;
  border-radius: 20px;
}

.agent-pulse-glow {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--status-confirmed);
  box-shadow: 0 0 10px var(--status-confirmed);
  transition: all 0.4s ease;
}

.agent-pulse-glow.active {
  animation: pulse-emerald 2s infinite ease-in-out;
}

.agent-pulse-glow.inactive {
  background: var(--muted);
  box-shadow: none;
}

@keyframes pulse-emerald {
  0% {
    transform: scale(0.9);
    box-shadow: 0 0 0 0 rgba(154, 201, 171, 0.7);
  }
  70% {
    transform: scale(1.15);
    box-shadow: 0 0 0 8px rgba(154, 201, 171, 0);
  }
  100% {
    transform: scale(0.9);
    box-shadow: 0 0 0 0 rgba(154, 201, 171, 0);
  }
}

.status-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--champagne-light);
}

/* Marketing KPIs */
.marketing-grid-kpi {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-top: 24px;
}

.metric-card-kpi {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(11, 13, 17, 0.75);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.02);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.metric-card-kpi:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-sm), var(--shadow-gold);
}

.metric-card-kpi span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.metric-card-kpi strong {
  display: block;
  margin-top: 10px;
  font-family: var(--font-serif);
  font-size: 32px;
  font-weight: 600;
  color: var(--champagne-light);
  text-shadow: 0 0 10px rgba(215, 181, 109, 0.1);
}

/* Chart Styles */
.chart-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.chart-legend {
  display: flex;
  gap: 20px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--soft);
  font-weight: 500;
}

.legend-color-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.legend-color-dot.spend {
  background: var(--champagne);
  box-shadow: 0 0 6px var(--champagne);
}

.legend-color-dot.leads {
  background: var(--status-confirmed);
  box-shadow: 0 0 6px var(--status-confirmed);
}

.chart-container {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(4, 5, 6, 0.3);
  padding: 24px;
  position: relative;
  overflow: hidden;
}

#marketingSvgChart path.line-spend {
  stroke: var(--champagne);
  stroke-width: 3.5px;
  stroke-linecap: round;
  fill: none;
  filter: drop-shadow(0 4px 8px rgba(215, 181, 109, 0.25));
}

#marketingSvgChart path.line-leads {
  stroke: var(--status-confirmed);
  stroke-width: 3.5px;
  stroke-linecap: round;
  fill: none;
  filter: drop-shadow(0 4px 8px rgba(154, 201, 171, 0.25));
}

#marketingSvgChart path.area-spend {
  fill: url(#spendGradient);
  opacity: 0.15;
}

#marketingSvgChart path.area-leads {
  fill: url(#leadsGradient);
  opacity: 0.15;
}

#marketingSvgChart .grid-line {
  stroke: rgba(215, 181, 109, 0.04);
  stroke-width: 1px;
}

#marketingSvgChart .grid-label {
  fill: var(--muted);
  font-size: 10px;
  font-weight: 500;
  font-family: var(--font-sans);
}

#marketingSvgChart .chart-dot {
  stroke-width: 2.5px;
  r: 4px;
  transition: r 0.2s ease, stroke-width 0.2s ease;
  cursor: pointer;
}

#marketingSvgChart .chart-dot.spend {
  stroke: var(--champagne);
  fill: var(--bg-canvas);
}

#marketingSvgChart .chart-dot.leads {
  stroke: var(--status-confirmed);
  fill: var(--bg-canvas);
}

#marketingSvgChart .chart-dot:hover {
  r: 6.5px;
  stroke-width: 3.5px;
}

/* Agent Console (Terminal) */
.console-panel {
  display: flex;
  flex-direction: column;
}

.agent-console {
  flex-grow: 1;
  background: #040507;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 16px 20px;
  font-family: "Courier New", Courier, monospace;
  font-size: 13px;
  line-height: 1.6;
  color: #c9b9a6;
  height: 280px;
  overflow-y: auto;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.8);
}

.console-line {
  margin-bottom: 8px;
  word-wrap: break-word;
  opacity: 0.9;
  animation: logSlide 0.25s ease-out;
}

.console-line.system {
  color: var(--muted);
  font-style: italic;
}

.console-line.info {
  color: #b2c9e4;
}

.console-line.success {
  color: var(--status-confirmed);
  text-shadow: 0 0 4px rgba(154, 201, 171, 0.2);
}

.console-line.warning {
  color: var(--status-deposit);
}

.console-line.thought {
  color: var(--champagne-light);
  border-left: 2px solid var(--champagne);
  padding-left: 10px;
  margin: 12px 0;
  font-style: italic;
}

@keyframes logSlide {
  from {
    transform: translateY(4px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 0.9;
  }
}

/* Sparkle icon for AI button */
.sparkle-icon {
  margin-right: 6px;
  color: var(--champagne);
  text-shadow: 0 0 6px var(--champagne);
  animation: rotateSparkle 4s infinite linear;
  display: inline-block;
}

@keyframes rotateSparkle {
  0% { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(180deg) scale(1.2); }
  100% { transform: rotate(360deg) scale(1); }
}

/* Campaigns Manager */
.campaigns-list-wrapper {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.campaign-card {
  display: grid;
  grid-template-columns: 240px 1fr 180px;
  gap: 24px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(11, 13, 17, 0.65);
  align-items: center;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.campaign-card:hover {
  border-color: var(--line-strong);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
}

.campaign-meta h4 {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 4px;
}

.campaign-meta p {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.campaign-audience {
  font-size: 12px;
  color: var(--soft);
  margin-top: 8px;
  font-style: italic;
  line-height: 1.4;
}

.campaign-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  background: rgba(4, 5, 6, 0.2);
  border: 1px solid var(--line);
  padding: 12px 20px;
  border-radius: 10px;
}

.campaign-stat-item span {
  display: block;
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.campaign-stat-item strong {
  display: block;
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  margin-top: 4px;
}

.campaign-control-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-end;
}

.budget-slider-container {
  width: 100%;
}

.budget-slider-label {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 700;
  color: var(--soft);
  margin-bottom: 6px;
}

.budget-slider-label strong {
  color: var(--champagne);
}

/* Rich Range Input */
input[type="range"].campaign-budget-slider {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--bg-input);
  border: 1px solid var(--line);
  outline: none;
  margin: 10px 0;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.5);
}

input[type="range"].campaign-budget-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--gold-gradient);
  border: 1px solid var(--champagne);
  cursor: pointer;
  box-shadow: 0 0 8px rgba(215, 181, 109, 0.5);
  transition: transform 0.1s ease;
}

input[type="range"].campaign-budget-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

/* Campaign Status Toggle */
.campaign-action-row {
  display: flex;
  gap: 10px;
  width: 100%;
}

.campaign-status-btn {
  flex-grow: 1;
  min-height: 36px !important;
  font-size: 10px !important;
  padding: 6px 12px !important;
}

.campaign-status-btn.active-state {
  border-color: rgba(154, 201, 171, 0.4);
  color: var(--status-confirmed);
  background: rgba(154, 201, 171, 0.08);
}

.campaign-status-btn.paused-state {
  border-color: rgba(229, 179, 163, 0.4);
  color: var(--status-deposit);
  background: rgba(229, 179, 163, 0.08);
}

.campaign-status-btn.active-state:hover {
  background: rgba(154, 201, 171, 0.15);
}

.campaign-status-btn.paused-state:hover {
  background: rgba(229, 179, 163, 0.15);
}

@media (max-width: 1024px) {
  .campaign-card {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .campaign-control-col {
    align-items: stretch;
  }
}

@media (max-width: 768px) {
  .campaign-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Voice AI Premium Dashboard Styles */
.voice-pulse-glow {
  display: inline-block;
  width: 10px;
  height: 10px;
  background-color: var(--status-confirmed);
  border-radius: 50%;
  margin-right: 8px;
  box-shadow: 0 0 10px var(--status-confirmed);
  transition: all 0.3s ease;
}

.voice-pulse-glow.speaking {
  background-color: var(--champagne);
  box-shadow: 0 0 12px var(--champagne);
  animation: voicePulseSpeak 1.2s infinite ease-in-out;
}

@keyframes voicePulseSpeak {
  0% { transform: scale(0.9); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.8; }
}

.voice-split-layout {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 24px;
  align-items: start;
  margin-top: 24px;
}

@media (max-width: 1100px) {
  .voice-split-layout {
    grid-template-columns: 1fr;
  }
}

.simulator-layout {
  display: flex;
  gap: 20px;
}

@media (max-width: 768px) {
  .simulator-layout {
    flex-direction: column;
  }
}

.simulator-chat {
  height: 280px;
  overflow-y: auto;
  border: 1px solid var(--line);
  background: rgba(8, 10, 12, 0.9);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: inset 0 2px 8px rgba(0,0,0,0.8);
}

.bubble {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: var(--font-size-sm);
  line-height: 1.4;
  animation: bubbleFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes bubbleFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.bubble.agent {
  align-self: flex-start;
  background: rgba(215, 181, 109, 0.08);
  border: 1px solid rgba(215, 181, 109, 0.3);
  color: var(--champagne-light);
  border-top-left-radius: 2px;
}

.bubble.customer {
  align-self: flex-end;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--color-foreground);
  border-top-right-radius: 2px;
}

.bubble.system {
  align-self: center;
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed rgba(255, 255, 255, 0.08);
  color: var(--color-muted);
  font-size: var(--font-size-xs);
  text-align: center;
  max-width: 95%;
  border-radius: 6px;
  padding: 6px 12px;
}

.bubble.typing {
  align-self: flex-start;
  background: rgba(215, 181, 109, 0.04);
  border: 1px solid rgba(215, 181, 109, 0.15);
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.typing-dots {
  display: flex;
  gap: 4px;
}

.typing-dots span {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--champagne);
  border-radius: 50%;
  animation: typingDotBounce 1.4s infinite both;
}

.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingDotBounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1.1); opacity: 1; }
}

.simulator-crm-status {
  flex: 1;
  border: 1px solid var(--line);
  background: rgba(14, 16, 20, 0.5);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.simulator-crm-status h4 {
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-muted);
  margin-bottom: 4px;
  font-weight: 700;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}

.crm-badges-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.crm-badge {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--line);
  border-radius: 6px;
  transition: all 0.3s ease;
  font-size: var(--font-size-xs);
}

.crm-badge .label {
  color: var(--color-muted);
  font-weight: 500;
}

.crm-badge .value {
  color: rgba(255, 255, 255, 0.3);
  font-weight: 600;
  text-align: right;
  max-width: 60%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.crm-badge.active {
  background: rgba(154, 201, 171, 0.05);
  border-color: rgba(154, 201, 171, 0.4);
  box-shadow: 0 0 10px rgba(154, 201, 171, 0.05);
}

.crm-badge.active .value {
  color: var(--status-confirmed);
}

.crm-simulation-lead-alert {
  margin-top: auto;
  display: flex;
  gap: 10px;
  padding: 12px;
  background: rgba(154, 201, 171, 0.08);
  border: 1px solid rgba(154, 201, 171, 0.4);
  border-radius: 8px;
  animation: leadAlertFadeIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes leadAlertFadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.crm-simulation-lead-alert .icon {
  font-size: 16px;
  color: var(--status-confirmed);
  font-weight: bold;
  line-height: 1.2;
}

.crm-simulation-lead-alert .alert-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: var(--font-size-xs);
}

.crm-simulation-lead-alert .alert-content strong {
  color: var(--status-confirmed);
}

.crm-simulation-lead-alert .alert-content span {
  color: var(--color-muted);
}

.voice-dialog-details {
  background: rgba(0, 0, 0, 0.4);
  padding: 14px 16px;
  border-radius: 8px;
  border: 1px solid var(--line);
  margin-top: 8px;
  font-size: var(--font-size-sm);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.voice-dialog-turn {
  line-height: 1.4;
}

.voice-dialog-turn strong {
  color: var(--champagne-light);
  margin-right: 6px;
}

.voice-dialog-turn.customer strong {
  color: var(--color-muted);
}

/* ── Phase 100 — Excel-style tab strip (корешки): one section at a time ───── */
.tab-strip {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  gap: 4px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 10px 12px 0;
  margin: -8px -8px 18px;
  background: var(--bg-canvas);
  border-bottom: 1px solid var(--line-strong);
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}
.tab-strip::-webkit-scrollbar { height: 6px; }
.tab-strip::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 999px; }
.tab-strip a {
  flex: 0 0 auto;
  padding: 9px 16px;
  border: 1px solid var(--line);
  border-bottom: none;
  border-radius: 10px 10px 0 0;
  background: var(--bg-card);
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.tab-strip a:hover { background: var(--bg-card-hover); color: var(--ink); }
.tab-strip a.active {
  background: var(--bg-card-hover);
  color: var(--champagne-light);
  border-color: var(--champagne);
  box-shadow: 0 -2px 0 var(--champagne) inset;
}
@media (max-width: 720px) {
  .tab-strip { margin: -8px -8px 14px; padding: 8px 10px 0; }
  .tab-strip a { padding: 8px 13px; font-size: 12px; }
}
/* The top tab strip now IS the section nav, so the desktop sidebar's duplicate
   vertical list is hidden — brand + useful-links panel stay. (Sidebar is already
   hidden entirely on mobile, where the bottom-nav handles thumbs.) */
.sidebar .nav { display: none; }

