/* =========================================================
   SISTEM REQUEST & CETAK RESI J&T CARGO (A4 BAGI 4)
   ========================================================= */

:root {
  --primary: #00b075;
  --primary-hover: #009663;
  --primary-light: rgba(0, 176, 117, 0.12);
  --primary-glow: rgba(0, 176, 117, 0.35);
  
  --dark-bg: #0b0f17;
  --dark-surface: #111827;
  --dark-surface-2: #1f2937;
  --dark-surface-3: #374151;
  --dark-border: #2d3748;
  
  --text-main: #f9fafb;
  --text-muted: #9ca3af;
  --text-dim: #6b7280;
  
  --accent-gold: #f59e0b;
  --accent-blue: #3b82f6;
  --accent-red: #ef4444;
  --accent-emerald: #10b981;
  
  --font-main: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'Space Grotesk', monospace, sans-serif;
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 22px;
  
  --shadow-subtle: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-card: 0 10px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.2);
  --shadow-glow: 0 0 20px rgba(0, 176, 117, 0.25);
}

/* Light Theme Variables */
body.theme-light {
  --dark-bg: #f1f5f9;
  --dark-surface: #ffffff;
  --dark-surface-2: #f8fafc;
  --dark-surface-3: #e2e8f0;
  --dark-border: #cbd5e1;
  
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-dim: #64748b;
  
  --shadow-card: 0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
}

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

body {
  font-family: var(--font-main);
  background-color: var(--dark-bg);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.5;
  overflow-x: hidden;
  transition: background-color 0.25s ease, color 0.25s ease;
}

/* Custom Scrollbars */
.custom-scroll::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
.custom-scroll::-webkit-scrollbar-track {
  background: transparent;
}
.custom-scroll::-webkit-scrollbar-thumb {
  background: var(--dark-surface-3);
  border-radius: 4px;
}
.custom-scroll::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

/* App Container */
.app-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* ---------------------------------------------------------
   TOP NAVIGATION
   --------------------------------------------------------- */
.top-nav {
  height: 64px;
  background: var(--dark-surface);
  border-bottom: 1px solid var(--dark-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 50;
  flex-shrink: 0;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-badge {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo-wrap {
  height: 32px;
  display: flex;
  align-items: center;
  background: transparent;
  padding: 0;
  border-radius: 0;
}

.brand-svg-nav {
  height: 28px;
  width: auto;
  object-fit: contain;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: var(--primary);
}

.brand-tagline {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-dim);
  letter-spacing: 0.4px;
}

/* Tabs */
.nav-center {
  display: flex;
  align-items: center;
}

.nav-tabs {
  display: flex;
  background: var(--dark-bg);
  padding: 4px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--dark-border);
  gap: 4px;
}

.tab-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-main);
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.tab-btn:hover {
  color: var(--text-main);
  background: var(--dark-surface-2);
}

.tab-btn.active {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 2px 10px var(--primary-glow);
}

.badge-count {
  background: rgba(255, 255, 255, 0.25);
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 10px;
  font-weight: 700;
}

/* Nav Right */
.nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-icon {
  background: var(--dark-bg);
  border: 1px solid var(--dark-border);
  color: var(--text-main);
  padding: 8px 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.2s ease;
}

.btn-icon:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* ---------------------------------------------------------
   MAIN WORKSPACE & TABS
   --------------------------------------------------------- */
.main-workspace {
  flex: 1;
  overflow: hidden;
  position: relative;
}

.tab-pane {
  display: none;
  height: 100%;
  width: 100%;
  animation: fadeIn 0.2s ease;
}

.tab-pane.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Workspace Grid (Split View for Create Tab) */
.workspace-grid {
  display: grid;
  grid-template-columns: 520px 1fr;
  height: 100%;
}

@media (max-width: 1100px) {
  .workspace-grid {
    grid-template-columns: 1fr;
    overflow-y: auto;
  }
}

/* ---------------------------------------------------------
   FORM PANEL & SLOT STEPPER BAR
   --------------------------------------------------------- */
.form-panel {
  background: var(--dark-surface);
  border-right: 1px solid var(--dark-border);
  height: 100%;
  overflow-y: auto;
  padding: 16px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.slot-stepper-container {
  background: var(--dark-surface-2);
  border: 1px solid var(--dark-border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
}

.stepper-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

/* Resi Dynamic Tabs Header */
.resi-tabs-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--dark-bg);
  border: 1px solid var(--dark-border);
  padding: 8px 12px;
  border-radius: var(--radius-md);
  margin-bottom: 16px;
}

.resi-tabs-list {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.resi-tab-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--dark-surface-2);
  border: 1px solid var(--dark-border);
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.resi-tab-item:hover {
  border-color: var(--primary);
  color: var(--text-main);
}

.resi-tab-item.active {
  background: rgba(0, 176, 117, 0.18);
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary);
}

.resi-tab-item .tab-del-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 12px;
  cursor: pointer;
  padding: 0 2px;
  margin-left: 2px;
  display: inline-flex;
  align-items: center;
  transition: color 0.15s ease;
}

.resi-tab-item .tab-del-btn:hover {
  color: var(--accent-red);
}

.btn-add-resi-tab {
  background: var(--primary);
  color: #ffffff;
  border: none;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.btn-add-resi-tab:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.card-section {
  background: var(--dark-bg);
  border: 1px solid var(--dark-border);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 16px;
}

.card-section.highlight-penerima {
  border-left: 3px solid var(--primary);
}

.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.section-title h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.section-title.space-between {
  justify-content: space-between;
}

.title-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.title-actions {
  display: flex;
  gap: 6px;
}

.btn-chip {
  background: var(--dark-surface-2);
  border: 1px solid var(--dark-border);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-chip:hover {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
}

/* Form Controls */
.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

.form-row-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
  width: 100%;
  box-sizing: border-box;
}

.form-row-4 .form-group {
  min-width: 0;
  margin-bottom: 0;
}

.form-row-4 input {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  padding: 8px 6px;
  text-align: center;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-group label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.form-group label .required {
  color: var(--accent-red);
}

.form-group input,
.form-group select,
.form-group textarea {
  background: var(--dark-surface);
  border: 1px solid var(--dark-border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  color: var(--text-main);
  font-family: var(--font-main);
  font-size: 13px;
  transition: all 0.2s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.input-with-action {
  display: flex;
  gap: 6px;
}

.input-with-action input {
  flex: 1;
}

.btn-action {
  background: var(--dark-surface-2);
  border: 1px solid var(--dark-border);
  color: var(--primary);
  padding: 0 10px;
  font-weight: 700;
  font-size: 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.btn-action:hover {
  background: var(--primary);
  color: #fff;
}

.highlight-weight input {
  border-color: var(--primary);
  font-weight: 800;
  color: var(--primary);
  font-size: 15px;
}

/* Logo Upload Control */
.logo-upload-box {
  background: var(--dark-surface);
  border: 1px dashed var(--dark-border);
  border-radius: var(--radius-md);
  padding: 12px;
}

.upload-controls {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo-preview-thumb {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--dark-bg);
  border: 2px solid var(--accent-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.2);
  flex-shrink: 0;
}

.logo-preview-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.logo-preview-thumb span {
  color: var(--text-dim);
  font-size: 20px;
}

.upload-btns {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.btn-outline-sm {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--dark-surface-2);
  border: 1px solid var(--dark-border);
  color: var(--text-main);
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  width: fit-content;
}

.btn-outline-sm:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-text-sm {
  background: none;
  border: none;
  font-size: 11px;
  cursor: pointer;
  text-align: left;
  padding: 2px 0;
}

.file-hint {
  font-size: 10px;
  color: var(--text-dim);
}

/* Sticky Form Actions */
.form-actions-sticky {
  margin-top: auto;
  padding-top: 16px;
  display: flex;
  gap: 10px;
  position: sticky;
  bottom: 0;
  background: var(--dark-surface);
  border-top: 1px solid var(--dark-border);
}

.btn-primary {
  flex: 2;
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 12px 16px;
  font-family: var(--font-main);
  font-size: 14px;
  font-weight: 700;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 14px var(--primary-glow);
  transition: all 0.2s ease;
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.btn-primary-ghost {
  flex: 1.5;
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid var(--primary);
  padding: 12px 14px;
  font-family: var(--font-main);
  font-size: 13px;
  font-weight: 700;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.btn-primary-ghost:hover {
  background: var(--primary);
  color: #fff;
}

.btn-secondary {
  flex: 1;
  background: var(--dark-surface-2);
  color: var(--text-muted);
  border: 1px solid var(--dark-border);
  padding: 12px 14px;
  font-family: var(--font-main);
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-secondary:hover {
  background: var(--dark-surface-3);
  color: var(--text-main);
}


/* ---------------------------------------------------------
   LIVE PREVIEW PANEL (10x10 CM SQUARE)
   --------------------------------------------------------- */
.preview-panel {
  background: var(--dark-bg);
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.preview-header {
  padding: 14px 20px;
  background: var(--dark-surface);
  border-bottom: 1px solid var(--dark-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.preview-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 700;
}

.size-badge {
  background: var(--primary-light);
  color: var(--primary);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--primary);
}

.preview-toolbar {
  display: flex;
  gap: 8px;
}

.btn-tool {
  background: var(--dark-surface-2);
  border: 1px solid var(--dark-border);
  color: var(--text-main);
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.preview-stage {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  background: var(--dark-bg);
}

/* LIVE A4 PRINT SHEET SIMULATOR (ZOOMED & EXACT PRINT MATCH) */
.live-a4-paper-wrapper {
  width: 794px;
  min-height: 1123px;
  background: #ffffff;
  color: #000000;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
  position: relative;
  overflow: hidden;
  border-radius: 4px;
  margin: 10px auto;
}

.live-a4-grid {
  display: grid;
  grid-template-columns: 397px 397px;
  grid-template-rows: 374.3px 374.3px 374.3px;
  width: 100%;
  height: 100%;
}

.live-a4-slot {
  width: 397px;
  height: 374.3px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-sizing: border-box;
  padding: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.live-a4-slot:hover {
  background: rgba(0, 176, 117, 0.04);
}

.live-a4-slot.active-editing {
  background: rgba(0, 176, 117, 0.06);
}

.live-a4-slot.active-editing::after {
  content: 'SEDANG DIEDIT ✏️';
  position: absolute;
  top: 8px;
  right: 12px;
  background: var(--primary);
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 4px;
  z-index: 10;
  pointer-events: none;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}

.live-a4-slot .jt-label {
  width: 350px;
  height: 350px;
  max-width: 350px;
  max-height: 350px;
  border: 2px solid #000000;
  display: flex;
  flex-direction: column;
}

.live-a4-slot .label-header {
  background: #00b075;
  padding: 4px 10px 4px 8px;
  height: 40px;
}

.live-a4-slot .logo-emerald-badge {
  background: transparent;
  padding: 0;
  height: auto;
}

.live-a4-slot .jt-svg-logo {
  height: 24px !important;
}

.live-a4-slot .resi-number-display {
  font-size: 15px;
}

.live-a4-slot .service-badge-pill {
  background: #ffffff;
  color: #00b075;
  font-size: 9px;
  padding: 1px 6px;
}

.live-a4-slot .label-barcode-row {
  height: 28px;
  padding: 2px 0;
}

.live-a4-slot .label-barcode-row svg {
  height: 26px;
}

.live-a4-slot .penerima-section {
  padding: 4px 10px;
}

.live-a4-slot .penerima-name {
  font-size: 14px;
}

.live-a4-slot .penerima-phone {
  font-size: 12px;
}

.live-a4-slot .penerima-address {
  font-size: 11.5px;
  line-height: 1.25;
}

.live-a4-slot .pengirim-section {
  padding: 4px 10px;
}

.live-a4-slot .pengirim-name {
  font-size: 12px;
}

.live-a4-slot .pengirim-phone {
  font-size: 11px;
}

.live-a4-slot .pengirim-address {
  font-size: 10.5px;
}

.live-a4-slot .shop-logo-frame {
  width: 52px;
  height: 52px;
}

.live-a4-slot .label-notes-row {
  padding: 3px 10px;
  font-size: 10px;
}

.live-a4-slot .label-footer-grid {
  height: 44px;
}

.live-a4-slot .footer-dimensi-col {
  padding: 3px 10px;
}

.live-a4-slot .dimensi-val {
  font-size: 12.5px;
}

.live-a4-slot .koli-info {
  font-size: 9px;
}

.live-a4-slot .footer-berat-col {
  padding: 3px 10px;
}

.live-a4-slot .berat-number {
  font-size: 22px;
}

.live-a4-slot .berat-unit {
  font-size: 12px;
}

.live-slot-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1.5px dashed #cbd5e1;
  border-radius: 6px;
  width: 92%;
  height: 92%;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 700;
  transition: all 0.2s ease;
  background: #f8fafc;
}

.live-a4-slot:hover .live-slot-empty {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(0, 176, 117, 0.05);
}

.live-a4-paper-wrapper .print-cut-line-v {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 290px;
  width: 0;
  border-left: 1.5px dashed #cbd5e1;
  pointer-events: none;
  z-index: 20;
}

.live-a4-paper-wrapper .print-cut-line-h1 {
  position: absolute;
  left: 0;
  right: 0;
  top: 273.3px;
  height: 0;
  border-top: 1.5px dashed #cbd5e1;
  pointer-events: none;
  z-index: 20;
}

.live-a4-paper-wrapper .print-cut-line-h2 {
  position: absolute;
  left: 0;
  right: 0;
  top: 546.6px;
  height: 0;
  border-top: 1.5px dashed #cbd5e1;
  pointer-events: none;
  z-index: 20;
}

.label-wrapper-shadow {
  box-shadow: var(--shadow-card);
  border-radius: 4px;
  background: #ffffff;
}

/* ---------------------------------------------------------
   THE J&T CARGO SHIPPING LABEL (EXACT 10x10 CM RATIO)
   --------------------------------------------------------- */
.jt-label {
  width: 380px;
  height: 380px;
  max-width: 380px;
  max-height: 380px;
  background: #ffffff;
  color: #000000;
  font-family: var(--font-main);
  border: 2px solid #000000;
  position: relative;
  box-sizing: border-box;
  user-select: text;
  line-height: 1.2;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}

/* Header: Full Emerald Green Bar */
.label-header {
  background: #00b075;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 10px 4px 8px;
  flex-shrink: 0;
  min-height: 40px;
}

.header-logo-container {
  display: flex;
  align-items: center;
}

.logo-emerald-badge {
  background: transparent;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
}

.jt-svg-logo {
  height: 24px;
  width: auto;
  display: block;
}

.header-resi-info {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
}

.resi-number-display {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 0.8px;
  color: #ffffff;
  line-height: 1.1;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

.service-badge-pill {
  background: #ffffff;
  color: #00b075;
  font-size: 9px;
  font-weight: 900;
  padding: 1px 6px;
  border-radius: 2px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

/* Barcode */
.label-barcode-row {
  background: #ffffff;
  padding: 2px 8px 1px;
  display: flex;
  justify-content: center;
  border-bottom: 1.5px solid #000000;
  flex-shrink: 0;
}

.barcode-svg {
  max-width: 100%;
  height: 28px;
}

/* Penerima Section */
.label-section {
  padding: 4px 10px;
}

.section-label-tag {
  font-size: 10.5px;
  font-weight: 900;
  color: #000000;
  letter-spacing: 0.3px;
  margin-bottom: 1px;
  text-transform: uppercase;
}

.penerima-name {
  font-size: 15px;
  font-weight: 900;
  color: #000000;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  line-height: 1.15;
  word-break: break-word;
  overflow-wrap: break-word;
}

.penerima-phone {
  font-size: 13px;
  font-weight: 800;
  color: #000000;
  letter-spacing: 0.3px;
  margin-bottom: 2px;
}

.penerima-address {
  font-size: 10px;
  font-weight: 600;
  color: #111827;
  line-height: 1.25;
  word-break: break-word;
  overflow-wrap: break-word;
  word-wrap: break-word;
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Dashed Divider */
.label-divider-dashed {
  border-top: 1.5px dashed #9ca3af;
  margin: 3px 10px;
  flex-shrink: 0;
}

/* Pengirim Section with Large Photo Box */
.pengirim-section {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 2px 10px;
  flex: 1;
}

.pengirim-details {
  flex: 1;
  min-width: 0;
}

.pengirim-name {
  font-size: 13px;
  font-weight: 900;
  color: #000000;
  text-transform: uppercase;
  word-break: break-word;
  overflow-wrap: break-word;
  line-height: 1.15;
}

.pengirim-phone {
  font-size: 11px;
  font-weight: 800;
  color: #000000;
  margin-bottom: 1px;
}

.pengirim-address {
  font-size: 9.5px;
  font-weight: 500;
  color: #374151;
  line-height: 1.2;
  word-break: break-word;
  overflow-wrap: break-word;
  word-wrap: break-word;
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.package-contents-tag {
  font-size: 8.5px;
  font-weight: 700;
  color: #4b5563;
  background: #f3f4f6;
  display: inline-block;
  padding: 1px 4px;
  border-radius: 2px;
  margin-top: 2px;
}

/* Shop Logo Frame (Large photo area matching red box) */
.pengirim-logo-col {
  width: 95px;
  height: 95px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.shop-logo-frame {
  width: 90px;
  height: 90px;
  border-radius: 8px;
  border: 2px solid #f59e0b;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.35);
  background: #0f172a;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.shop-logo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.shop-logo-default {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #f59e0b;
  text-align: center;
  width: 100%;
  height: 100%;
}

.logo-inner-circle {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.logo-inner-circle i {
  font-size: 30px;
}

.store-text {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.4px;
}

/* Notes / Fragile banner */
.label-notes-row {
  margin: 1px 10px 3px;
  display: flex;
  align-items: center;
  gap: 6px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  padding: 2px 6px;
  border-radius: 2px;
  flex-shrink: 0;
}

.fragile-badge {
  background: #ef4444;
  color: #ffffff;
  font-size: 8px;
  font-weight: 900;
  padding: 1px 4px;
  border-radius: 2px;
  letter-spacing: 0.3px;
}

.notes-text {
  font-size: 9.5px;
  font-weight: 700;
  color: #92400e;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Solid divider */
.label-divider-solid {
  border-top: 2px solid #000000;
  flex-shrink: 0;
}

/* Footer: Dimensi & Berat Total */
.label-footer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: #ffffff;
  flex-shrink: 0;
}

.footer-dimensi-col {
  padding: 4px 10px;
  border-right: 2px solid #000000;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.footer-field-label {
  font-size: 9.5px;
  font-weight: 800;
  color: #4b5563;
  letter-spacing: 0.3px;
}

.dimensi-val {
  font-size: 13px;
  font-weight: 900;
  color: #000000;
  letter-spacing: 0.3px;
}

.koli-info {
  font-size: 9px;
  font-weight: 700;
  color: #6b7280;
}

.footer-berat-col {
  padding: 4px 10px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
}

.berat-val-row {
  display: flex;
  align-items: baseline;
  gap: 3px;
}

.berat-number {
  font-size: 26px;
  font-weight: 900;
  color: #000000;
  line-height: 1;
  font-family: var(--font-mono);
}

.berat-unit {
  font-size: 13px;
  font-weight: 900;
  color: #000000;
}

/* Corner Cut Markers */
.corner-marker {
  position: absolute;
  width: 6px;
  height: 6px;
  border-color: #9ca3af;
  border-style: solid;
  pointer-events: none;
}
.corner-marker.top-left { top: -1px; left: -1px; border-width: 1.5px 0 0 1.5px; }
.corner-marker.top-right { top: -1px; right: -1px; border-width: 1.5px 1.5px 0 0; }
.corner-marker.bottom-left { bottom: -1px; left: -1px; border-width: 0 0 1.5px 1.5px; }
.corner-marker.bottom-right { bottom: -1px; right: -1px; border-width: 0 1.5px 1.5px 0; }


/* ---------------------------------------------------------
   TAB 2: A4 SHEET (BAGI 6 / 2x3 CELLS 105x99mm)
   --------------------------------------------------------- */
.a4-workspace-container {
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--dark-bg);
}

.a4-control-bar {
  padding: 14px 24px;
  background: var(--dark-surface);
  border-bottom: 1px solid var(--dark-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.a4-view-title {
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

.a4-view-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.a4-control-bar .bar-right {
  display: flex;
  gap: 8px;
}

.btn-secondary-sm {
  background: var(--dark-surface-2);
  border: 1px solid var(--dark-border);
  color: var(--text-main);
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-secondary-sm:hover {
  background: var(--dark-surface-3);
}

.btn-primary-sm {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 700;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-primary-sm:hover {
  background: var(--primary-hover);
}

.btn-emerald-sm {
  background: var(--accent-blue);
  color: #fff;
  border: none;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 700;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-emerald-sm:hover {
  filter: brightness(1.1);
}

.btn-danger-sm {
  background: rgba(239, 68, 68, 0.15);
  color: var(--accent-red);
  border: 1px solid var(--accent-red);
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-danger-sm:hover {
  background: var(--accent-red);
  color: #fff;
}

.a4-preview-scroll {
  flex: 1;
  overflow: auto;
  padding: 30px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

/* Scaled A4 Sheet Simulation (Exact 210mm x 297mm ratio divided into 6 cells) */
.a4-paper-wrapper {
  width: 794px; /* ~210mm at 96dpi */
  height: 1123px; /* ~297mm at 96dpi */
  min-height: 1123px;
  background: #ffffff;
  color: #000;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
  padding: 0;
  box-sizing: border-box;
  position: relative;
  overflow: hidden;
}

.a4-grid-2x3 {
  display: grid;
  grid-template-columns: 397px 397px;
  grid-template-rows: 374.3px 374.3px 374.3px;
  width: 100%;
  height: 100%;
}

.a4-slot {
  width: 397px;
  height: 374.3px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background: #f8fafc;
  box-sizing: border-box;
  padding: 6px;
}

.a4-slot:has(.jt-label) {
  background: #ffffff;
}

.slot-empty-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: #94a3b8;
  padding: 12px;
  text-align: center;
  border: 1.5px dashed #cbd5e1;
  border-radius: 6px;
  width: 350px;
  height: 350px;
  justify-content: center;
  box-sizing: border-box;
}

.slot-empty-placeholder i {
  font-size: 28px;
}

.slot-empty-placeholder span {
  font-size: 12px;
  font-weight: 600;
}

.btn-slot-add {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 700;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.btn-slot-add:hover {
  background: var(--primary-hover);
}

.a4-slot .jt-label {
  width: 350px;
  height: 350px;
  max-width: 350px;
  max-height: 350px;
}

.a4-slot .slot-action-btn-remove {
  position: absolute;
  top: 10px;
  right: 14px;
  background: rgba(239, 68, 68, 0.9);
  color: #fff;
  border: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  z-index: 10;
}

.a4-slot .slot-action-btn-remove:hover {
  background: #dc2626;
}

/* Edge-to-edge full cutting guide lines for 6 cells */
.a4-cut-line-v {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 397px;
  width: 0;
  border-left: 1.5px dashed #94a3b8;
  pointer-events: none;
  z-index: 20;
}

.a4-cut-line-h1 {
  position: absolute;
  left: 0;
  right: 0;
  top: 374.3px;
  height: 0;
  border-top: 1.5px dashed #94a3b8;
  pointer-events: none;
  z-index: 20;
}

.a4-cut-line-h2 {
  position: absolute;
  left: 0;
  right: 0;
  top: 748.6px;
  height: 0;
  border-top: 1.5px dashed #94a3b8;
  pointer-events: none;
  z-index: 20;
}

.a4-cut-center-icon1 {
  position: absolute;
  top: 374.3px;
  left: 397px;
  transform: translate(-50%, -50%);
  background: #ffffff;
  color: #64748b;
  padding: 3px;
  border-radius: 50%;
  font-size: 12px;
  pointer-events: none;
  z-index: 21;
  border: 1px solid #cbd5e1;
}

.a4-cut-center-icon2 {
  position: absolute;
  top: 748.6px;
  left: 397px;
  transform: translate(-50%, -50%);
  background: #ffffff;
  color: #64748b;
  padding: 3px;
  border-radius: 50%;
  font-size: 12px;
  pointer-events: none;
  z-index: 21;
  border: 1px solid #cbd5e1;
}


/* ---------------------------------------------------------
   TAB 3: RIWAYAT RESI
   --------------------------------------------------------- */
.history-container {
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 24px;
  background: var(--dark-bg);
}

.history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.history-search-box {
  flex: 1;
  max-width: 480px;
  position: relative;
}

.history-search-box i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
}

.history-search-box input {
  width: 100%;
  background: var(--dark-surface);
  border: 1px solid var(--dark-border);
  border-radius: var(--radius-md);
  padding: 10px 14px 10px 36px;
  color: var(--text-main);
  font-size: 13px;
}

.history-search-box input:focus {
  outline: none;
  border-color: var(--primary);
}

.history-table-wrapper {
  flex: 1;
  background: var(--dark-surface);
  border: 1px solid var(--dark-border);
  border-radius: var(--radius-md);
  overflow: auto;
}

.history-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}

.history-table th {
  background: var(--dark-surface-2);
  color: var(--text-muted);
  font-weight: 700;
  padding: 12px 16px;
  border-bottom: 1px solid var(--dark-border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.history-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--dark-border);
  color: var(--text-main);
}

.history-table tr:hover td {
  background: var(--dark-surface-2);
}

.history-resi-tag {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--primary);
}

.history-name {
  font-weight: 700;
}

.history-sub {
  font-size: 11px;
  color: var(--text-dim);
}

.history-actions-row {
  display: flex;
  gap: 6px;
}

.btn-tbl {
  background: var(--dark-surface-3);
  border: none;
  color: var(--text-main);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 12px;
}

.btn-tbl:hover {
  background: var(--primary);
  color: #fff;
}

.btn-tbl.delete:hover {
  background: var(--accent-red);
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: var(--text-dim);
  gap: 12px;
}

.empty-state i {
  font-size: 48px;
}

.history-bottom-bar {
  margin-top: 14px;
  padding: 12px 18px;
  background: var(--dark-surface);
  border: 1px solid var(--dark-border);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.bottom-bar-btns {
  display: flex;
  gap: 10px;
}


/* ---------------------------------------------------------
   MODALS
   --------------------------------------------------------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

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

.modal-card {
  background: var(--dark-surface);
  border: 1px solid var(--dark-border);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 540px;
  box-shadow: var(--shadow-card);
  overflow: hidden;
  animation: modalIn 0.2s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--dark-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 24px;
  cursor: pointer;
}

.modal-close:hover {
  color: var(--text-main);
}

.modal-body {
  padding: 20px;
}

.modal-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.smart-sample-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
  padding: 8px 12px;
  background: var(--dark-bg);
  border: 1px dashed var(--dark-border);
  border-radius: var(--radius-sm);
}

.sample-label {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 5px;
}

.btn-sample-chip {
  background: var(--dark-surface-2);
  border: 1px solid var(--dark-border);
  color: var(--text-main);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s ease;
}

.btn-sample-chip:hover {
  background: rgba(0, 176, 117, 0.15);
  border-color: var(--primary);
  color: var(--primary-light);
  transform: translateY(-1px);
}

.modal-body textarea {
  width: 100%;
  background: var(--dark-bg);
  border: 1px solid var(--dark-border);
  border-radius: var(--radius-sm);
  padding: 10px;
  color: var(--text-main);
  font-family: var(--font-main);
  font-size: 13px;
}

.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--dark-border);
  background: var(--dark-surface-2);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}


/* ---------------------------------------------------------
   TOAST NOTIFICATIONS
   --------------------------------------------------------- */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 9999;
}

.toast {
  background: var(--dark-surface);
  color: var(--text-main);
  border-left: 4px solid var(--primary);
  border-top: 1px solid var(--dark-border);
  border-right: 1px solid var(--dark-border);
  border-bottom: 1px solid var(--dark-border);
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-card);
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideToast 0.25s ease;
}

@keyframes slideToast {
  from { transform: translateX(50px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}


/* ---------------------------------------------------------
   PRINT CONTAINER (HIDDEN ON SCREEN)
   --------------------------------------------------------- */
.print-container,
#printOnlyContainer {
  display: none !important;
}


/* =========================================================
   PRINT STYLESHEET (A4 PORTRAIT BAGI 6: 2 KOLOM x 3 BARIS)
   ========================================================= */
@media print {
  @page {
    size: A4 portrait;
    margin: 0mm;
  }

  body, html {
    margin: 0 !important;
    padding: 0 !important;
    background: #ffffff !important;
    color: #000000 !important;
    width: 210mm !important;
    height: 297mm !important;
    overflow: hidden !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  /* Hide app shell */
  body > *:not(#printOnlyContainer),
  header,
  nav,
  main,
  .navbar,
  .main-workspace,
  .app-container,
  .top-nav,
  .form-panel,
  .preview-panel,
  .preview-header,
  .preview-toolbar,
  .preview-stage,
  .a4-control-bar,
  .btn-slot-add,
  .slot-action-btn-remove,
  .slot-empty-placeholder,
  .modal-overlay,
  .toast-container {
    display: none !important;
  }

  /* Enable Print Container */
  .print-container,
  #printOnlyContainer {
    display: block !important;
    width: 210mm !important;
    height: 297mm !important;
    position: relative !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  /* A4 6-Cell Sheet (Grid 2x3: 2 columns of 105mm, 3 rows of 99mm) */
  .a4-print-sheet {
    display: grid !important;
    grid-template-columns: 105mm 105mm !important;
    grid-template-rows: 99mm 99mm 99mm !important;
    width: 210mm !important;
    height: 297mm !important;
    position: relative !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    padding: 0 !important;
    page-break-inside: avoid !important;
    page-break-after: avoid !important;
  }

  .a4-print-cell {
    width: 105mm !important;
    height: 99mm !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
    padding: 1.5mm !important;
    position: relative !important;
  }

  .a4-print-cell .jt-label {
    width: 96mm !important;
    height: 96mm !important;
    max-width: 96mm !important;
    max-height: 96mm !important;
    border: 1.8px solid #000000 !important;
    box-sizing: border-box !important;
    page-break-inside: avoid !important;
  }

  /* Dynamic Smart Cut Lines are generated programmatically per active label */

  /* Full Emerald Green Header for Print */
  .label-header {
    background: #00b075 !important;
    color: #ffffff !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .logo-emerald-badge {
    background: transparent !important;
    box-shadow: none !important;
  }

  .service-badge-pill {
    background: #ffffff !important;
    color: #00b075 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .jt-svg-logo {
    display: block !important;
    height: 24px !important;
    width: auto !important;
  }

  .penerima-name,
  .penerima-phone,
  .pengirim-name,
  .dimensi-val,
  .berat-number {
    color: #000000 !important;
  }

  .shop-logo-frame {
    border-color: #000000 !important;
    box-shadow: none !important;
  }
}
