/* Promo Banner */
.promo-banner {
  background: #fff8e1;
  border: 1px solid #ffcc02;
  border-radius: 8px;
  margin: 20px 16px;
  padding: 16px 24px;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

.promo-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.promo-text strong {
  display: block;
  color: #c62828;
  font-size: 1.05em;
  margin-bottom: 4px;
}

.promo-text span {
  font-size: 0.9em;
  color: #555;
}

.promo-text a {
  color: #c62828;
  text-decoration: underline;
}

.promo-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.promo-code {
  background: #e65100;
  color: #fff;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 0.95em;
}

.promo-btn {
  background: #f57c00;
  color: #fff;
  padding: 8px 18px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9em;
}

.promo-btn:hover {
  background: #e65100;
  color: #fff;
  text-decoration: none;
}

.promo-hint {
  font-size: 0.82em;
  color: #666;
}

.promo-stack {
  font-size: 1.1em;
  color: #1a237e;
  font-weight: 700;
  display: block;
  margin-top: 6px;
}

@media (max-width: 767px) {
  .promo-banner {
    margin: 12px 16px;
    padding: 14px 16px;
    overflow: hidden;
  }
  .promo-inner {
    flex-direction: column;
    align-items: flex-start;
  }
  .promo-text span {
    word-wrap: break-word;
  }
}

/* Global */
*, *::before, *::after {
  box-sizing: border-box;
}

#page-wrapper {
  overflow-x: hidden;
  width: 100%;
  position: relative;
}

/* Site Header */
.site-header {
  background: #fff;
  border-bottom: 1px solid #e8e8e8;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.header-inner {
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  height: 64px;
}

.site-logo {
  font-size: 1.4em;
  font-weight: 700;
  color: #1a237e;
  text-decoration: none;
  margin-right: 20px;
  white-space: nowrap;
}

.site-logo:hover {
  color: #0d47a1;
  text-decoration: none;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  flex-wrap: nowrap;
}

.site-nav > a {
  color: #444;
  text-decoration: none;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 0.88em;
  font-weight: 500;
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
}

.site-nav > a:hover {
  background: #f0f0f0;
  color: #1a237e;
  text-decoration: none;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.header-user {
  color: #555;
  font-size: 0.9em;
  font-weight: 500;
  margin-right: 4px;
}

.btn-header {
  display: inline-block;
  padding: 8px 20px;
  border-radius: 20px;
  font-size: 0.9em;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-header-outline {
  color: #1a237e;
  border: 1.5px solid #1a237e;
  background: transparent;
}

.btn-header-outline:hover {
  background: #1a237e;
  color: #fff;
  text-decoration: none;
}

.btn-header-primary {
  color: #fff;
  background: #1a237e;
  border: 1.5px solid #1a237e;
}

.btn-header-primary:hover {
  background: #0d47a1;
  border-color: #0d47a1;
  color: #fff;
  text-decoration: none;
}

/* Footer */
.site-footer {
  background: #1a237e;
  color: #ccc;
  padding: 50px 0 0;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
}

.footer-col h4 {
  color: #fff;
  font-size: 1em;
  margin-bottom: 15px;
}

.footer-col p {
  font-size: 0.9em;
  line-height: 1.6;
  color: #aaa;
}

.footer-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-col ul li {
  margin-bottom: 8px;
}

.footer-col ul a {
  color: #ccc;
  text-decoration: none;
  font-size: 0.9em;
}

.footer-col ul a:hover {
  color: #fff;
  text-decoration: underline;
}

.footer-bottom {
  text-align: center;
  padding: 20px;
  margin-top: 40px;
  border-top: 1px solid rgba(255,255,255,0.1);
  font-size: 0.85em;
  color: #888;
}

@media (max-width: 767px) {
  .footer-inner {
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    padding: 0 16px;
  }
  .footer-col:first-child {
    grid-column: 1 / -1;
  }
}

/* Main content */
.site-main {
  padding: 40px 0;
  min-height: calc(100vh - 64px);
  background: #fafafa;
}

.site-main .container {
  max-width: 1100px;
}

/* Chart containers */
.chart-container {
  position: relative;
  width: 100%;
  height: 400px;
}

/* Mobile navigation toggle */
.nav-toggle {
  display: none;
  background: none;
  color: #1a237e;
  border: none;
  padding: 8px 12px;
  font-size: 1.4em;
  cursor: pointer;
  border-radius: 6px;
}

.nav-toggle:hover {
  background: #f0f0f0;
}

/* Responsive tables */
.table-responsive-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 1280px) {
  .header-inner {
    height: 56px;
    padding: 0 16px;
    position: relative;
  }

  .nav-toggle {
    display: block;
    margin-left: auto;
  }

  .site-nav {
    display: none;
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    background: #fff;
    flex-direction: column;
    align-items: stretch;
    padding: 0;
    gap: 0;
    border-bottom: 1px solid #e8e8e8;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 1001;
  }

  .site-nav.open {
    display: flex;
  }

  .site-nav > a {
    padding: 14px 20px;
    border-radius: 0;
    border-bottom: 1px solid #f5f5f5;
    font-size: 1em;
  }

  .nav-actions {
    padding: 12px 20px;
    border-top: 1px solid #eee;
    margin-left: 0;
    gap: 10px;
  }
}

@media (max-width: 767px) {
  .chart-container {
    height: 300px;
  }

  .site-main {
    padding: 24px 0;
  }

  .site-main .container {
    padding: 0 16px;
  }

  .welcome-header {
    padding: 20px 15px !important;
  }

  .welcome-header h1 {
    font-size: 1.4em;
  }

  .section-card {
    padding: 15px !important;
  }

  .download-table {
    font-size: 0.9em;
  }

  .download-table th,
  .download-table td {
    padding: 8px 10px !important;
  }

  img {
    max-width: 100%;
    height: auto;
  }

  #chart {
    max-height: 300px !important;
  }

  #snapshotTable {
    font-size: 0.85em;
  }

  .form-control.d-inline-block {
    width: 100% !important;
    display: block !important;
  }
}
