/* =============================================
   PALHA PRINTING - Design System
   Premium Industrial Typography Theme
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@400;600;700;800;900&family=Barlow:wght@300;400;500;600&display=swap');

:root {
  --ink: #0d1b2a;
  --paper: #f0f4f8;
  --press-red: #1565c0;
  --press-red-dark: #0d47a1;
  --gold: #f59e0b;
  --mid: #546e7a;
  --light: #dce8f0;
  --white: #ffffff;
  --success: #2a7a3b;
  --warning: #f59e0b;
  --danger: #c8291a;
  --info: #1565c0;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.12);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.18);
  --radius: 4px;
  --font-display: 'Barlow Condensed', sans-serif;
  --font-body: 'Barlow', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.6;
}

/* ---- NAVBAR ---- */
.navbar {
  background: var(--ink);
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}
.navbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 64px;
}
.navbar-brand {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 900;
  color: var(--white);
  text-decoration: none;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.navbar-brand span { color: var(--press-red); }
.navbar-nav { display: flex; align-items: center; gap: 4px; }
.nav-link {
  color: rgba(255,255,255,0.75);
  text-decoration: none;
  padding: 8px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  transition: all 0.2s;
}
.nav-link:hover, .nav-link.active { color: var(--white); background: rgba(255,255,255,0.1); }
.btn-nav {
  background: var(--press-red);
  color: var(--white) !important;
  padding: 8px 20px !important;
  font-weight: 600 !important;
}
.btn-nav:hover { background: var(--press-red-dark) !important; }

/* ---- BUTTONS ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
  letter-spacing: 0.3px;
}
.btn-primary { background: var(--press-red); color: var(--white); }
.btn-primary:hover { background: var(--press-red-dark); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-dark { background: var(--ink); color: var(--white); }
.btn-dark:hover { background: #222; }
.btn-outline { background: transparent; border: 2px solid var(--ink); color: var(--ink); }
.btn-outline:hover { background: var(--ink); color: var(--white); }
.btn-gold { background: var(--gold); color: var(--white); }
.btn-gold:hover { background: #a87a20; }
.btn-success { background: var(--success); color: var(--white); }
.btn-sm { padding: 6px 14px; font-size: 12px; }
.btn-lg { padding: 14px 32px; font-size: 16px; }
.btn-block { width: 100%; justify-content: center; }

/* ---- HERO ---- */
.hero {
  background: var(--ink);
  min-height: 85vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 40px,
    rgba(21,101,192,0.04) 40px,
    rgba(21,101,192,0.04) 80px
  );
}
.hero-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 80px 24px;
  position: relative;
  z-index: 1;
}
.hero-tag {
  display: inline-block;
  background: var(--press-red);
  color: var(--white);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  padding: 6px 14px;
  margin-bottom: 24px;
}
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(56px, 8vw, 96px);
  font-weight: 900;
  color: var(--white);
  line-height: 0.95;
  text-transform: uppercase;
  letter-spacing: -1px;
  margin-bottom: 24px;
}
.hero h1 em { color: var(--press-red); font-style: normal; }
.hero p {
  color: rgba(255,255,255,0.6);
  font-size: 18px;
  max-width: 520px;
  margin-bottom: 40px;
  line-height: 1.7;
}
.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; }
.hero-stats {
  display: flex;
  gap: 48px;
  margin-top: 80px;
  padding-top: 40px;
  border-top: 1px solid rgba(255,255,255,0.1);
}
.stat-item { color: var(--white); }
.stat-number {
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 900;
  color: var(--press-red);
  line-height: 1;
}
.stat-label { font-size: 12px; color: rgba(255,255,255,0.5); text-transform: uppercase; letter-spacing: 1px; }

/* ---- SECTIONS ---- */
.section { padding: 80px 24px; }
.section-inner { max-width: 1200px; margin: 0 auto; }
.section-header { margin-bottom: 48px; }
.section-tag {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--press-red);
  margin-bottom: 12px;
}
.section-title {
  font-family: var(--font-display);
  font-size: clamp(32px, 4vw, 48px);
  font-weight: 800;
  text-transform: uppercase;
  line-height: 1.1;
  letter-spacing: -0.5px;
}
.section-dark { background: var(--ink); }
.section-dark .section-title, .section-dark p { color: var(--white); }

/* ---- CARDS ---- */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow 0.2s, transform 0.2s;
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.card-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--light);
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.card-body { padding: 24px; }
.card-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--light);
  background: #faf7f2;
}

/* ---- PRODUCT GRID ---- */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}
.product-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 24px;
  border: 2px solid transparent;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s;
  cursor: pointer;
}
.product-card:hover, .product-card.selected {
  border-color: var(--press-red);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.product-category {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--press-red);
  font-weight: 700;
  margin-bottom: 8px;
}
.product-name {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.product-price {
  font-size: 22px;
  font-weight: 700;
  color: var(--press-red);
}
.product-unit { font-size: 12px; color: var(--mid); }

/* ---- FORMS ---- */
.form-group { margin-bottom: 20px; }
.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 6px;
  color: var(--mid);
}
.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 2px solid var(--light);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 14px;
  background: var(--white);
  transition: border-color 0.2s;
}
.form-control:focus {
  outline: none;
  border-color: var(--press-red);
}
textarea.form-control { resize: vertical; min-height: 100px; }
select.form-control { cursor: pointer; }

/* ---- UPLOAD ZONE ---- */
.upload-zone {
  border: 3px dashed var(--light);
  border-radius: var(--radius);
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: #faf7f2;
}
.upload-zone:hover, .upload-zone.dragover {
  border-color: var(--press-red);
  background: rgba(200,41,26,0.03);
}
.upload-icon { font-size: 48px; margin-bottom: 12px; }
.upload-text { font-family: var(--font-display); font-size: 20px; font-weight: 700; text-transform: uppercase; }
.upload-subtext { color: var(--mid); font-size: 13px; margin-top: 4px; }

/* ---- STATUS BADGES ---- */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.badge-pending { background: #fff3cd; color: #856404; }
.badge-confirmed { background: #cfe2ff; color: #084298; }
.badge-in_production { background: #fff3cd; color: #c9972b; }
.badge-ready { background: #d1e7dd; color: #0a3622; }
.badge-delivered { background: #d1e7dd; color: var(--success); }
.badge-cancelled { background: #f8d7da; color: #842029; }
.badge-paid { background: #d1e7dd; color: var(--success); }
.badge-unpaid { background: #f8d7da; color: #842029; }
.badge-approved { background: #d1e7dd; color: var(--success); }
.badge-rejected { background: #f8d7da; color: #842029; }
.badge-b2b { background: var(--gold); color: var(--white); }

/* ---- DASHBOARD ---- */
.dashboard-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}
.sidebar {
  background: var(--ink);
  padding: 0;
  position: sticky;
  top: 64px;
  height: calc(100vh - 64px);
  overflow-y: auto;
}
.sidebar-section { padding: 24px 0 8px; }
.sidebar-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.3);
  padding: 0 20px 8px;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  color: rgba(255,255,255,0.65);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.15s;
  border-left: 3px solid transparent;
}
.sidebar-link:hover { color: var(--white); background: rgba(255,255,255,0.05); }
.sidebar-link.active { color: var(--white); border-left-color: var(--press-red); background: rgba(200,41,26,0.1); }
.sidebar-icon { width: 18px; text-align: center; font-size: 16px; }
.main-content { padding: 32px; background: var(--paper); }

/* ---- STATS GRID ---- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}
.stat-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  border-left: 4px solid var(--press-red);
}
.stat-card-value {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 900;
  line-height: 1;
  margin-bottom: 4px;
}
.stat-card-label { font-size: 12px; color: var(--mid); text-transform: uppercase; letter-spacing: 1px; }

/* ---- TABLES ---- */
.table-wrapper { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
thead th {
  background: var(--ink);
  color: var(--white);
  padding: 12px 16px;
  text-align: left;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
tbody tr { border-bottom: 1px solid var(--light); transition: background 0.1s; }
tbody tr:hover { background: #faf7f2; }
tbody td { padding: 12px 16px; }

/* ---- ALERTS ---- */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius);
  margin-bottom: 20px;
  font-size: 14px;
  border-left: 4px solid;
}
.alert-success { background: #d1e7dd; color: #0a3622; border-color: var(--success); }
.alert-danger { background: #f8d7da; color: #842029; border-color: var(--danger); }
.alert-warning { background: #fff3cd; color: #664d03; border-color: var(--warning); }
.alert-info { background: #cfe2ff; color: #084298; border-color: var(--info); }

/* ---- ORDER STATUS TIMELINE ---- */
.timeline { display: flex; align-items: center; gap: 0; margin: 24px 0; }
.timeline-step {
  flex: 1;
  text-align: center;
  position: relative;
}
.timeline-step::before {
  content: '';
  position: absolute;
  top: 16px;
  left: -50%;
  width: 100%;
  height: 2px;
  background: var(--light);
  z-index: 0;
}
.timeline-step:first-child::before { display: none; }
.timeline-step.done::before { background: var(--press-red); }
.timeline-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--light);
  border: 3px solid var(--light);
  margin: 0 auto 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  position: relative;
  z-index: 1;
}
.timeline-step.done .timeline-dot { background: var(--press-red); border-color: var(--press-red); color: var(--white); }
.timeline-step.active .timeline-dot { background: var(--white); border-color: var(--press-red); color: var(--press-red); }
.timeline-label { font-size: 11px; color: var(--mid); text-transform: uppercase; letter-spacing: 0.5px; }

/* ---- INVOICE ---- */
.invoice-box {
  background: var(--white);
  max-width: 800px;
  margin: 0 auto;
  padding: 48px;
  box-shadow: var(--shadow-lg);
}
.invoice-header { display: flex; justify-content: space-between; margin-bottom: 40px; }
.invoice-logo {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 900;
  text-transform: uppercase;
}
.invoice-logo span { color: var(--press-red); }
.invoice-number { text-align: right; }
.invoice-number h2 {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--press-red);
}
.invoice-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; margin-bottom: 40px; }
.party-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--mid);
  margin-bottom: 8px;
}
.party-name { font-family: var(--font-display); font-size: 20px; font-weight: 800; }
.invoice-total-row {
  display: flex;
  justify-content: flex-end;
  padding: 16px 0;
  border-top: 3px solid var(--ink);
  margin-top: 8px;
}
.invoice-total-label { font-family: var(--font-display); font-size: 20px; font-weight: 800; text-transform: uppercase; }
.invoice-total-value { font-family: var(--font-display); font-size: 28px; font-weight: 900; color: var(--press-red); min-width: 140px; text-align: right; }

/* ---- PAGE HEADER ---- */
.page-header {
  background: var(--ink);
  padding: 40px 24px;
  margin-bottom: 0;
}
.page-header-inner { max-width: 1200px; margin: 0 auto; }
.page-header h1 {
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 900;
  text-transform: uppercase;
  color: var(--white);
  letter-spacing: -0.5px;
}
.page-breadcrumb {
  font-size: 13px;
  color: rgba(255,255,255,0.4);
  margin-bottom: 8px;
}
.page-breadcrumb a { color: rgba(255,255,255,0.6); text-decoration: none; }

/* ---- GRID UTILITIES ---- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.gap-20 { gap: 20px; }
.mb-0 { margin-bottom: 0; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }
.mt-24 { margin-top: 24px; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-red { color: var(--press-red); }
.text-mid { color: var(--mid); }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.items-center { align-items: center; }
.gap-8 { gap: 8px; }
.gap-16 { gap: 16px; }
.font-display { font-family: var(--font-display); }
.font-bold { font-weight: 700; }
.uppercase { text-transform: uppercase; }
.divider { border: none; border-top: 1px solid var(--light); margin: 24px 0; }

/* ---- FOOTER ---- */
footer {
  background: var(--ink);
  color: rgba(255,255,255,0.5);
  padding: 48px 24px 24px;
  margin-top: auto;
}
.footer-inner { max-width: 1200px; margin: 0 auto; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 48px; margin-bottom: 40px; }
.footer-brand {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 900;
  color: var(--white);
  text-transform: uppercase;
  margin-bottom: 12px;
}
.footer-brand span { color: var(--press-red); }
.footer-links { list-style: none; }
.footer-links li { margin-bottom: 8px; }
.footer-links a { color: rgba(255,255,255,0.5); text-decoration: none; font-size: 14px; transition: color 0.2s; }
.footer-links a:hover { color: var(--white); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 24px;
  font-size: 12px;
  display: flex;
  justify-content: space-between;
}

/* ---- RESPONSIVE ---- */
@media (max-width: 768px) {
  .dashboard-layout { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .grid-2, .grid-3, .footer-grid { grid-template-columns: 1fr; }
  .hero-stats { flex-wrap: wrap; gap: 24px; }
  .invoice-parties { grid-template-columns: 1fr; }
  .invoice-box { padding: 24px; }
  .navbar-nav .nav-link:not(.btn-nav) { display: none; }
}

/* ---- PRINT ---- */
@media print {
  .navbar, .sidebar, .btn, footer { display: none !important; }
  .invoice-box { box-shadow: none; padding: 0; }
}
