/* =============================================
   KaspiPDF v2 — SmartBID Design System
   Brand: #E8503A (coral red)
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --brand:        #E8503A;
  --brand-hover:  #D44430;
  --brand-light:  #FDF1EF;
  --bg:           #F5F6FA;
  --sidebar-bg:   #FFFFFF;
  --sidebar-w:    64px;
  --topnav-h:     60px;
  --card-bg:      #FFFFFF;
  --border:       #E8EAF0;
  --text:         #1E1E1E;
  --text-muted:   #8F9BB3;
  --input-bg:     #F0F2F7;
  --shadow:       0 1px 4px rgba(0,0,0,0.07);
}

* { box-sizing: border-box; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  margin: 0;
  padding: 0;
  color: var(--text);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ════════════════════════════════════════
   TOP NAVIGATION
   ════════════════════════════════════════ */

.top-nav {
  height: var(--topnav-h);
  background: #fff;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 20px 0 0;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
}

.top-nav-logo {
  width: var(--sidebar-w);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.top-nav-logo .logo-icon {
  width: 36px;
  height: 36px;
  background: var(--brand);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: -0.5px;
  text-decoration: none;
}

.top-nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  border-right: 1px solid var(--border);
  margin-right: 16px;
  height: 100%;
}

.top-nav-brand-text {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
  letter-spacing: -0.3px;
  white-space: nowrap;
}

.top-nav-brand-text span {
  color: var(--brand);
}

.top-nav-service {
  background: var(--brand);
  color: #fff;
  font-weight: 600;
  font-size: 0.85rem;
  padding: 7px 14px;
  border-radius: 7px;
  white-space: nowrap;
}

.top-nav-spacer { flex: 1; }

.top-nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.top-nav-link {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
  white-space: nowrap;
}

.top-nav-link:hover { color: var(--text); background: var(--bg); }

.top-nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 12px;
}

.top-nav-icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  transition: color 0.15s;
}

.top-nav-icon-btn:hover { color: var(--text); }

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

.app-wrapper {
  display: flex;
  flex: 1;
  padding-top: var(--topnav-h);
}

/* ════════════════════════════════════════
   SIDEBAR (collapsible)
   ════════════════════════════════════════ */

.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  position: fixed;
  top: var(--topnav-h);
  left: 0;
  bottom: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 0 12px;
  gap: 2px;
  transition: width 0.22s ease;
  overflow: hidden;
}

/* Expanded state */
.sidebar.expanded {
  width: 210px;
  align-items: flex-start;
}

/* Toggle button */
.sidebar-toggle {
  width: 44px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.95rem;
  cursor: pointer;
  margin-bottom: 6px;
  transition: color 0.12s, background 0.12s;
  flex-shrink: 0;
}

.sidebar-toggle:hover { background: var(--bg); color: var(--text); }

.sidebar.expanded .sidebar-toggle {
  width: calc(210px - 20px);
  justify-content: flex-end;
  padding-right: 4px;
}

/* Nav items */
.sidebar-link {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 1.15rem;
  text-decoration: none;
  transition: background 0.12s, color 0.12s, width 0.22s;
  position: relative;
  flex-shrink: 0;
  gap: 0;
  overflow: hidden;
  white-space: nowrap;
}

.sidebar.expanded .sidebar-link {
  width: calc(210px - 20px);
  padding: 0 12px;
  justify-content: flex-start;
  gap: 10px;
  font-size: 1.05rem;
}

.sidebar-link:hover { background: var(--bg); color: var(--text); }
.sidebar-link.active { background: var(--brand); color: #fff; }

/* Label (hidden when collapsed) */
.sidebar-label {
  font-size: 0.88rem;
  font-weight: 500;
  opacity: 0;
  width: 0;
  transition: opacity 0.15s, width 0.22s;
  overflow: hidden;
}

.sidebar.expanded .sidebar-label {
  opacity: 1;
  width: auto;
}

/* Tooltip (only when collapsed) */
.sidebar-link .sidebar-tooltip {
  position: absolute;
  left: 54px;
  background: #1E1E1E;
  color: #fff;
  font-size: 0.75rem;
  padding: 4px 8px;
  border-radius: 5px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s;
  z-index: 999;
}

.sidebar-link:hover .sidebar-tooltip { opacity: 1; }
.sidebar.expanded .sidebar-link .sidebar-tooltip { display: none; }

.badge-new-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 7px;
  height: 7px;
  background: #22c55e;
  border-radius: 50%;
  border: 1.5px solid #fff;
}

.sidebar.expanded .badge-new-dot {
  position: static;
  margin-left: auto;
  flex-shrink: 0;
}

/* ════════════════════════════════════════
   MAIN CONTENT
   ════════════════════════════════════════ */

.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  padding: 28px 28px 40px;
  min-width: 0;
  transition: margin-left 0.22s ease;
}

body.sidebar-open .main-content {
  margin-left: 210px;
}

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

.page-header {
  margin-bottom: 24px;
}

.page-header h1 {
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 4px;
}

.page-header p {
  color: var(--text-muted);
  margin: 0;
  font-size: 0.9rem;
}

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

.card-section {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}

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

.btn-brand {
  background: var(--brand);
  border: none;
  color: #fff;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: inherit;
}

.btn-brand:hover { background: var(--brand-hover); color: #fff; }
.btn-brand:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-outline-brand {
  background: transparent;
  border: 1.5px solid var(--brand);
  color: var(--brand);
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-outline-brand:hover { background: var(--brand); color: #fff; }

.btn-secondary {
  background: var(--input-bg);
  border: none;
  color: var(--text-muted);
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
}

/* ════════════════════════════════════════
   FORM ELEMENTS
   ════════════════════════════════════════ */

.form-control, .form-select {
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: var(--input-bg);
  font-size: 0.9rem;
  padding: 9px 12px;
  font-family: inherit;
  color: var(--text);
  transition: border-color 0.15s;
  width: 100%;
}

.form-control:focus, .form-select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(232,80,58,0.1);
  outline: none;
}

.form-label {
  font-weight: 500;
  font-size: 0.88rem;
  color: var(--text);
  margin-bottom: 6px;
  display: block;
}

.form-text {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ════════════════════════════════════════
   ACCORDION / COLLAPSIBLE
   ════════════════════════════════════════ */

.feature-accordion {
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}

.feature-accordion-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  background: var(--card-bg);
  cursor: pointer;
  user-select: none;
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--text);
  border: none;
  width: 100%;
  text-align: left;
  transition: background 0.12s;
  font-family: inherit;
}

.feature-accordion-header:hover { background: var(--bg); }

.feature-accordion-header .chevron {
  margin-left: auto;
  transition: transform 0.2s;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.feature-accordion-header.open .chevron { transform: rotate(180deg); }

.feature-accordion-body {
  display: none;
  padding: 0 20px 20px;
  background: var(--card-bg);
  border-top: 1px solid var(--bg);
}

.feature-accordion-body.open { display: block; }

/* ════════════════════════════════════════
   YOUTUBE LINK
   ════════════════════════════════════════ */

.yt-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #ff0000;
  font-size: 0.8rem;
  text-decoration: none;
  margin-left: 4px;
  opacity: 0.75;
}

.yt-link:hover { opacity: 1; }

/* ════════════════════════════════════════
   SWITCH TOGGLE
   ════════════════════════════════════════ */

.form-check-input[type="checkbox"][role="switch"] {
  accent-color: var(--brand);
}

/* ════════════════════════════════════════
   SELLER CONTACT PREVIEW
   ════════════════════════════════════════ */

.contact-preview {
  background: #e8f5e9;
  border: 1.5px solid #a5d6a7;
  border-radius: 10px;
  padding: 14px 16px;
  margin-top: 14px;
  display: none;
}

.contact-preview.visible { display: block; }

.preview-header {
  font-weight: 700;
  font-size: 0.9rem;
  color: #1b5e20;
  margin-bottom: 8px;
}

.preview-body {
  display: flex;
  align-items: center;
  gap: 14px;
}

.preview-main-text { font-size: 0.88rem; font-weight: 600; color: #2e7d32; margin-bottom: 4px; }
.preview-phone { font-size: 0.9rem; font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 5px; }
.preview-extra { font-size: 0.78rem; color: #555; margin-top: 3px; }
.preview-qr {
  width: 60px; height: 60px; background: #fff; border: 1px solid #ccc;
  border-radius: 6px; display: flex; align-items: center; justify-content: center;
  font-size: 0.65rem; color: #999; text-align: center; flex-shrink: 0;
}

/* ════════════════════════════════════════
   LOADER
   ════════════════════════════════════════ */

.loader-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,0.75);
  z-index: 999;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 14px;
}

.loader-overlay.active { display: flex; }

.loader-spinner {
  width: 44px;
  height: 44px;
  border: 4px solid var(--border);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loader-text { font-size: 0.9rem; color: #555; font-weight: 500; }

/* ════════════════════════════════════════
   FOOTER
   ════════════════════════════════════════ */

.site-footer {
  background: #1a1a2e;
  color: rgba(255,255,255,0.6);
  padding: 36px 28px 28px;
  margin-left: var(--sidebar-w);
  transition: margin-left 0.22s ease;
}

body.sidebar-open .site-footer {
  margin-left: 210px;
}

.footer-inner {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  max-width: 800px;
}

.footer-col { display: flex; flex-direction: column; gap: 7px; }

.footer-col-title {
  font-weight: 700;
  color: #fff;
  font-size: 0.82rem;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.footer-col a {
  color: rgba(255,255,255,0.55);
  text-decoration: none;
  font-size: 0.85rem;
  transition: color 0.15s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.footer-col a:hover { color: #fff; }
.footer-copy { font-weight: 600; color: rgba(255,255,255,0.65); font-size: 0.85rem; }
.footer-desc { font-size: 0.8rem; color: rgba(255,255,255,0.4); line-height: 1.5; }

/* ════════════════════════════════════════
   BOTTOM NAV (mobile)
   ════════════════════════════════════════ */

.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 58px;
  background: #fff;
  border-top: 1px solid var(--border);
  display: flex;
  z-index: 200;
}

.bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.68rem;
  font-weight: 500;
  transition: color 0.15s;
}

.bottom-nav-item i { font-size: 1.2rem; }
.bottom-nav-item.active { color: var(--brand); }

/* ════════════════════════════════════════
   WHATSAPP BUTTON
   ════════════════════════════════════════ */

.whatsapp-btn {
  position: fixed;
  bottom: 80px;
  right: 20px;
  width: 52px;
  height: 52px;
  background: #25d366;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
  box-shadow: 0 4px 14px rgba(37,211,102,0.4);
  animation: pulse-wa 2.5s infinite;
  transition: transform 0.15s;
}

.whatsapp-btn:hover { transform: scale(1.08); animation: none; }
.whatsapp-btn svg { width: 28px; height: 28px; }

@keyframes pulse-wa {
  0%, 100% { box-shadow: 0 4px 14px rgba(37,211,102,0.4); }
  50%       { box-shadow: 0 4px 22px rgba(37,211,102,0.65); }
}

/* ════════════════════════════════════════
   XML CONVERTER
   ════════════════════════════════════════ */

.converter-block {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 22px 24px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}

.converter-block-title {
  font-weight: 700;
  font-size: 0.97rem;
  color: var(--text);
  margin-bottom: 4px;
}

.converter-block-desc {
  font-size: 0.83rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

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

@media (max-width: 767px) {
  .top-nav-links,
  .top-nav-service { display: none; }

  .sidebar { display: none; }

  .main-content {
    margin-left: 0;
    padding: 16px 14px 76px;
  }

  .site-footer {
    margin-left: 0;
    padding: 24px 16px 80px;
  }

  .footer-inner { grid-template-columns: 1fr; gap: 16px; }

  .whatsapp-btn { bottom: 68px; right: 14px; }

  .top-nav-brand-text { display: none; }
}

@media (max-width: 480px) {
  .page-header h1 { font-size: 1.2rem; }
}
