/* CFO Cockpit «Фонари 1871» - Main Styles */

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

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

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-primary);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

/* Links */
a {
  color: var(--accent-copper);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--accent-linen);
}

/* Header */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: rgba(26, 18, 11, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--accent-copper);
  z-index: 1000;
  padding: 1rem 2rem;
}

.header-content {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  color: var(--accent-copper);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo-icon {
  width: 32px;
  height: 32px;
  background: var(--accent-copper);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.nav {
  display: flex;
  gap: 1.5rem;
}

.nav-link {
  font-size: 0.9rem;
  color: var(--text-secondary);
  padding: 0.5rem 0;
  border-bottom: 2px solid transparent;
  transition: all var(--transition-fast);
}

.nav-link:hover,
.nav-link.active {
  color: var(--accent-copper);
  border-bottom-color: var(--accent-copper);
}

/* Sections */
.section {
  padding: var(--section-padding);
  min-height: 100vh;
  scroll-margin-top: 80px;
}

.section-header {
  text-align: center;
  margin-bottom: 3rem;
}

.section-title {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  color: var(--accent-linen);
}

.section-subtitle {
  color: var(--text-secondary);
  font-size: 1.1rem;
}

/* Hero Section */
.hero {
  padding-top: 150px;
  background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
}

.hero-title {
  font-size: 3rem;
  text-align: center;
  margin-bottom: 1rem;
  color: var(--accent-linen);
}

.hero-subtitle {
  text-align: center;
  color: var(--text-secondary);
  margin-bottom: 3rem;
  font-size: 1.2rem;
}

/* KPI Cards */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--grid-gap);
  max-width: 1400px;
  margin: 0 auto;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--accent-copper);
  border-radius: var(--radius-lg);
  padding: var(--card-padding);
  text-align: center;
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.kpi-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover);
}

.kpi-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.kpi-label {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.kpi-value {
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent-linen);
  margin-bottom: 0.5rem;
}

.kpi-delta {
  font-family: var(--font-mono);
  font-size: 1rem;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-sm);
  display: inline-block;
}

.kpi-delta.positive {
  background: var(--positive);
  color: white;
}

.kpi-delta.negative {
  background: var(--negative);
  color: white;
}

/* Chart Containers */
.chart-container {
  background: var(--bg-card);
  border: 1px solid var(--accent-copper);
  border-radius: var(--radius-lg);
  padding: var(--card-padding);
  margin-bottom: 2rem;
}

.chart-title {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  color: var(--accent-linen);
  text-align: center;
}

.chart-wrapper {
  position: relative;
  height: 400px;
}

/* Tables */
.table-container {
  background: var(--bg-card);
  border: 1px solid var(--accent-copper);
  border-radius: var(--radius-lg);
  padding: var(--card-padding);
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.data-table th,
.data-table td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--bg-secondary);
}

.data-table th {
  background: var(--bg-secondary);
  color: var(--accent-copper);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 1px;
}

.data-table tr:hover {
  background: rgba(184, 115, 51, 0.1);
}

/* ABC Row Colors */
.row-stars { background: rgba(46, 92, 79, 0.15) !important; }
.row-pearls { background: rgba(212, 160, 23, 0.15) !important; }
.row-horses { background: rgba(184, 115, 51, 0.15) !important; }
.row-dogs { background: rgba(198, 93, 59, 0.15) !important; }
.row-problems { background: rgba(139, 69, 19, 0.15) !important; }

/* Status Badges */
.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
}

.badge-growth { background: var(--positive); color: white; }
.badge-crisis { background: var(--negative); color: white; }
.badge-new { background: var(--warning); color: black; }
.badge-gone { background: var(--neutral); color: white; }
.badge-stable { background: var(--accent-copper); color: white; }

/* Cards Grid */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--grid-gap);
}

.dish-card {
  background: var(--bg-card);
  border: 1px solid var(--accent-copper);
  border-radius: var(--radius-lg);
  padding: var(--card-padding);
  text-align: center;
  transition: transform var(--transition-normal);
}

.dish-card:hover {
  transform: translateY(-3px);
}

.dish-card.stars {
  border-color: var(--positive);
  box-shadow: 0 0 15px rgba(46, 92, 79, 0.3);
}

.dish-card.dogs {
  border-color: var(--negative);
  box-shadow: 0 0 15px rgba(198, 93, 59, 0.3);
}

.dish-image {
  width: 80px;
  height: 80px;
  background: var(--bg-secondary);
  border-radius: 50%;
  margin: 0 auto 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
}

.dish-name {
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.dish-margin {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent-linen);
}

.dish-badge {
  margin-top: 0.5rem;
  font-size: 0.75rem;
}

/* Filters */
.filter-container {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.filter-chip {
  padding: 0.5rem 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--accent-copper);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: 0.9rem;
}

.filter-chip:hover,
.filter-chip.active {
  background: var(--accent-copper);
  color: white;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: var(--accent-copper);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: 1rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn:hover {
  background: var(--accent-linen);
  color: var(--bg-primary);
}

.btn-secondary {
  background: transparent;
  border: 1px solid var(--accent-copper);
}

.btn-secondary:hover {
  background: var(--accent-copper);
  color: white;
}

/* Export Section */
.export-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--grid-gap);
  max-width: 800px;
  margin: 0 auto;
}

.export-card {
  background: var(--bg-card);
  border: 1px solid var(--accent-copper);
  border-radius: var(--radius-lg);
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-normal);
}

.export-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover);
}

.export-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.export-title {
  font-size: 1.1rem;
  color: var(--accent-linen);
  margin-bottom: 0.5rem;
}

.export-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* Footer */
.footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--accent-copper);
  padding: 2rem;
  text-align: center;
  color: var(--text-secondary);
}

.footer-text {
  font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 1200px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .cards-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
  .nav { display: none; }
  .kpi-grid { grid-template-columns: 1fr; }
  .cards-grid { grid-template-columns: repeat(2, 1fr); }
  .export-grid { grid-template-columns: 1fr; }
  .section-title { font-size: 1.75rem; }
  .hero-title { font-size: 2rem; }
  .chart-wrapper { height: 300px; }
}

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

/* Print Styles */
@media print {
  body {
    background: white !important;
    color: black !important;
  }
  
  .header,
  .filter-container,
  .export-grid {
    display: none !important;
  }
  
  .section {
    min-height: auto;
    page-break-inside: avoid;
  }
  
  .chart-container,
  .table-container,
  .kpi-card,
  .dish-card {
    background: white !important;
    border: 1px solid #ccc !important;
    box-shadow: none !important;
  }
  
  .kpi-value,
  .dish-margin,
  .section-title {
    color: black !important;
  }
}

/* Heatmap CSS Grid */
.heatmap-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  padding: 20px;
}

.heatmap-cell {
  padding: 15px;
  border-radius: 8px;
  text-align: center;
  color: white;
  font-size: 12px;
  min-height: 80px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  transition: transform 0.2s;
}

.heatmap-cell:hover {
  transform: scale(1.05);
}

.heatmap-cell .group-name {
  font-weight: 600;
  margin-bottom: 5px;
  font-size: 11px;
}

.heatmap-cell .foodcost-val {
  font-size: 16px;
  font-weight: bold;
}

.heatmap-cell.low { background: linear-gradient(135deg, #27AE60, #2ECC71); }
.heatmap-cell.medium { background: linear-gradient(135deg, #F39C12, #F1C40F); color: #333; }
.heatmap-cell.high { background: linear-gradient(135deg, #E74C3C, #C0392B); }
