/* ============================================
   BRIVOX — Delivery Report (Top Divers)
   Custom CSS for Web View & PDF Export
   ============================================ */
@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --bg-dark: #0a0a0a;
  --bg-page: #121212;
  --bg-card: rgba(255, 255, 255, 0.03);
  --bg-card-hover: rgba(255, 255, 255, 0.05);
  
  --text-primary: #f3f5f7;
  --text-secondary: rgba(243, 245, 247, 0.75);
  --text-muted: rgba(243, 245, 247, 0.45);
  
  --gold: #c9a227;
  --gold-soft: rgba(201, 162, 39, 0.1);
  --gold-glow: rgba(201, 162, 39, 0.2);
  
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.15);
  
  --font-display: 'Bebas Neue', sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  
  --wrap-max: 900px; /* A4 proportioned width for comfortable reading */
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ============================================ RESET ============================================ */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { 
  font-family: var(--font-body); 
  background: var(--bg-dark); 
  color: var(--text-primary); 
  line-height: 1.6; 
  -webkit-font-smoothing: antialiased; 
  overflow-x: hidden; 
}
a { text-decoration: none; color: inherit; transition: color 0.3s var(--ease); }
img { max-width: 100%; display: block; }
button { border: none; background: none; cursor: pointer; font-family: inherit; }
.wrap { width: 100%; max-width: var(--wrap-max); margin: 0 auto; padding: 0 16px; }

/* Utilities */
.gold { color: var(--gold); }
.noise { position: fixed; inset: 0; pointer-events: none; z-index: 9999; opacity: 0.02; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.5; transform: scale(1.5); } }

/* ============================================ EXPORT BAR (WEB ONLY) ============================================ */
.exportBar { 
  position: fixed; 
  top: 0; left: 0; right: 0; 
  background: rgba(10, 10, 10, 0.9); 
  backdrop-filter: blur(16px); 
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border); 
  z-index: 1000; 
  padding: 12px 0;
}
.exportRow { display: flex; justify-content: space-between; align-items: center; }
.brivoxLogo { height: 28px; width: auto; object-fit: contain; }

/* Buttons */
.btn { 
  display: inline-flex; align-items: center; gap: 8px; 
  padding: 10px 16px; font-size: 13px; font-weight: 600; 
  border-radius: 8px; transition: all 0.3s var(--ease); 
}
.btn i, .btn svg { width: 16px; height: 16px; }
.btn.ghost { color: var(--text-secondary); background: transparent; border: 1px solid var(--border); }
.btn.ghost:hover { background: rgba(255,255,255,0.05); color: var(--text-primary); }
.btn.primary { background: var(--gold); color: var(--bg-dark); }
.btn.primary:hover { background: #d4ad2e; box-shadow: 0 4px 15px rgba(201,162,39,0.2); transform: translateY(-1px); }

/* ============================================ DOCUMENT / PAGE STRUCTURE ============================================ */
.appFrame { padding-top: 80px; padding-bottom: 40px; }
.doc { display: flex; flex-direction: column; gap: 40px; }

/* The Page acts like an A4 Canvas */
.page { 
  background: var(--bg-page); 
  border: 1px solid var(--border); 
  border-radius: 12px; 
  padding: 40px; 
  display: flex; 
  flex-direction: column; 
  min-height: 297mm; /* Approximate A4 minimum height */
  position: relative;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0,0,0,0.4);
}

/* Page Header */
.pageTop { 
  display: flex; justify-content: space-between; align-items: flex-end; 
  padding-bottom: 20px; border-bottom: 1px solid var(--border); 
  margin-bottom: 32px; flex-wrap: wrap; gap: 16px;
}
.pageBrand img { height: 24px; width: auto; opacity: 0.9; }
.pageBadge { 
  display: flex; align-items: center; gap: 8px; 
  font-family: var(--font-display); font-size: 18px; 
  color: var(--gold); letter-spacing: 1px; text-transform: uppercase; 
}
.pageBadge svg { width: 16px; height: 16px; }
.pageContact { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-size: 11px; color: var(--text-muted); }

/* Page Body */
.pageBody { flex: 1; display: flex; flex-direction: column; gap: 16px; }

/* Page Footer */
.pageBottom { 
  display: flex; justify-content: space-between; align-items: center; 
  padding-top: 20px; border-top: 1px solid var(--border); 
  margin-top: 40px; font-size: 11px; color: var(--text-muted); font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.5px;
}
.metaLine { display: flex; align-items: center; gap: 8px; }
.sep { width: 4px; height: 4px; border-radius: 50%; background: var(--border-strong); }
.iconInline { display: inline-flex; align-items: center; gap: 6px; }
.iconInline svg, .iconInline i { width: 12px; height: 12px; }

/* ============================================ TYPOGRAPHY & CONTENT ============================================ */
.kicker { display: flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 700; color: var(--gold); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px; }
.kDot { width: 6px; height: 6px; border-radius: 50%; background: var(--gold); animation: pulse 2s infinite; }
.h1 { font-family: var(--font-display); font-size: 42px; line-height: 1.1; letter-spacing: 1px; color: var(--text-primary); margin-bottom: 16px; max-width: 90%; }
.sub { font-size: 14px; color: var(--text-secondary); line-height: 1.7; margin-bottom: 24px; max-width: 95%; }
.p { font-size: 13px; color: var(--text-secondary); line-height: 1.6; }
.p b { color: var(--text-primary); font-weight: 600; }

/* ============================================ COMPONENTS ============================================ */
/* Grids */
.grid.two { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media(min-width: 600px){ .grid.two { grid-template-columns: repeat(2, 1fr); } }

/* Cards */
.card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 24px; display: flex; flex-direction: column; gap: 12px; }
.sectionTitle { display: flex; align-items: center; gap: 8px; font-family: var(--font-display); font-size: 20px; color: var(--text-primary); letter-spacing: 1px; text-transform: uppercase; margin-bottom: 4px; }
.sectionTitle svg, .sectionTitle i { width: 18px; height: 18px; color: var(--gold); }

/* Chips */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 4px 10px; border-radius: 6px; font-size: 10px; font-weight: 700; background: rgba(255,255,255,0.04); color: var(--text-secondary); border: 1px solid var(--border); text-transform: uppercase; letter-spacing: 0.5px;}
.chip.gold { background: var(--gold-soft); color: var(--gold); border-color: rgba(201,162,39,0.2); }

/* Callout */
.callout { background: linear-gradient(135deg, rgba(201,162,39,0.05), transparent); border-left: 3px solid var(--gold); padding: 16px; border-radius: 0 8px 8px 0; }
.callout .t { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; color: var(--gold); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 6px; }
.callout .t svg { width: 14px; height: 14px; }
.callout p { font-size: 12px; color: var(--text-secondary); line-height: 1.6; }

/* Figures / Images */
.figure { background: #000; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.figure img { width: 100%; height: auto; object-fit: cover; }

/* Specs Table */
.specs { width: 100%; border-collapse: collapse; font-size: 12px; margin-top: 8px; }
.specs tr { border-bottom: 1px solid var(--border); }
.specs tr:last-child { border-bottom: none; }
.specs th { text-align: left; padding: 10px 8px 10px 0; color: var(--text-primary); font-weight: 600; white-space: nowrap; width: 25%; }
.specs td { padding: 10px 0 10px 8px; color: var(--text-secondary); }

/* Timeline */
.timeline { display: flex; flex-direction: column; gap: 16px; position: relative; padding-left: 12px; margin-top: 10px; }
.timeline::before { content: ''; position: absolute; left: 0; top: 12px; bottom: 12px; width: 1px; background: var(--border-strong); }
.step { position: relative; display: flex; gap: 16px; align-items: flex-start; }
.step .n { font-family: var(--font-display); font-size: 20px; color: var(--gold); line-height: 1; background: var(--bg-page); padding-top: 2px; }
.step .t { font-size: 13px; font-weight: 700; color: var(--text-primary); margin-bottom: 2px; }
.step .d { font-size: 12px; color: var(--text-muted); line-height: 1.5; }

/* ============================================ PRINT / PDF MEDIA QUERIES ============================================ */
/* CRITICAL: 
  These rules ensure that when the user presses CTRL+P or the PDF generation triggers, 
  the background remains dark and colors do not invert.
*/
@media print {
  /* Force exact colors in Chrome/Safari/Edge */
  * { 
    -webkit-print-color-adjust: exact !important; 
    print-color-adjust: exact !important; 
    color-adjust: exact !important; 
  }
  
  body { background: var(--bg-dark); }
  
  .no-print { display: none !important; }
  
  .appFrame { padding-top: 0; padding-bottom: 0; }
  
  .doc { gap: 0; }
  
  .page { 
    margin: 0; 
    padding: 10mm 15mm; 
    box-shadow: none; 
    border: none; 
    border-radius: 0;
    width: 100%;
    min-height: 297mm; /* Ensure it matches A4 height */
    page-break-after: always; 
    break-after: page; 
    page-break-inside: avoid;
  }
  
  /* Remove page break from the last page */
  .page:last-child { page-break-after: auto; break-after: auto; }
}