/* ================================================
   VINE MANAGEMENT — DEPOSIT SLIP STYLES
   Base styles (print-sized). @media screen scales up
   for comfortable on-screen editing.
   ================================================ */

.slip {
  width: 100%;
  height: 280px;
  background: #FAFAFA;
  display: flex;
  flex-direction: column;
  font-family: Helvetica, Arial, sans-serif;
  color: #1A1A1A;
  overflow: hidden;
  border: 1px solid #C0C0C0;
}

/* Header */
.slip .header {
  height: 34px;
  background: #ffffff;
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  flex-shrink: 0;
  border-bottom: 3px solid #2D6E38;
}
.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
}
.vine-logo {
  display: flex;
  align-items: center;
  gap: 7px;
}
.vine-logo svg {
  display: block;
  height: 22px;
  width: auto;
}
.vine-logo-img {
  display: block;
  height: 30px;
  width: auto;
  max-width: 120px;
  object-fit: contain;
}
.vine-logo-img-wrap .header-divider { display: none; }
.vine-logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1;
  padding-top: 1px;
}
.vine-logo-text .brand {
  color: #2D6E38;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 1.6px;
}
.vine-logo-text .brand-sub {
  color: #5A9467;
  font-size: 5px;
  font-weight: 700;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  margin-top: 2px;
}
.header-divider {
  width: 1px;
  align-self: center;
  height: 18px;
  background: #D0D0D0;
}
.header-title {
  color: #1A1A1A;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
}
.slip-badge {
  background: #2D6E38;
  color: #fff;
  font-size: 6.5px;
  font-weight: 800;
  letter-spacing: 0.7px;
  padding: 4px 8px;
  border-radius: 2px;
  text-transform: uppercase;
  white-space: nowrap;
}
.slip-badge.team {
  background: #1F4E28;
}
.receipt-num {
  font-size: 8px;
  font-weight: 800;
  color: #1A1A1A;
  letter-spacing: 0.3px;
  white-space: nowrap;
  display: none;
}
.receipt-num.visible { display: block; }
.header-required {
  color: #B8232F;
  font-size: 6.5px;
  font-weight: 700;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

/* Content rows */
.content {
  flex: 1;
  display: flex;
  flex-direction: column;
}
.row {
  display: flex;
  align-items: center;
  padding: 3px 10px;
  gap: 6px;
  border-bottom: 1px solid #E4E4E4;
  min-height: 0;
}
.row.fields-row { height: 28px; }
.row.checkbox-row {
  padding: 4px 10px;
  gap: 8px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.field label {
  font-size: 5.2px;
  font-weight: 700;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 0.35px;
  line-height: 1;
}
.req { color: #B8232F; }

input.inp {
  width: 100%;
  height: 12px;
  background: #fff;
  border: 1px solid #CFCFCF;
  border-radius: 2px;
  font-family: Helvetica, Arial, sans-serif;
  font-size: 8px;
  padding: 0 3px;
  outline: none;
  color: #1A1A1A;
  -webkit-appearance: none;
  appearance: none;
}
input.inp:focus {
  border-color: #2D6E38;
  box-shadow: 0 0 0 1px #2D6E38;
}
input.inp::placeholder { color: #bbb; }
input.inp[readonly] {
  background: #f5f5f5;
  color: #333;
}

input.cbox {
  width: 8px;
  height: 8px;
  border: 1px solid #888;
  background: #fff;
  border-radius: 1px;
  margin: 0; padding: 0;
  flex-shrink: 0;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  position: relative;
}
input.cbox:checked {
  background: #2D6E38;
  border-color: #2D6E38;
}
input.cbox:checked::after {
  content: "";
  position: absolute;
  left: 1.5px; top: -0.5px;
  width: 3px; height: 6px;
  border: solid #fff;
  border-width: 0 1.2px 1.2px 0;
  transform: rotate(45deg);
}

/* Checkbox grid */
.pt-label {
  flex: 0 0 66px;
  font-size: 5.2px;
  font-weight: 700;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 0.35px;
  padding-top: 2px;
  line-height: 1.2;
}
.pt-grid {
  flex: 1 1 0;
  display: grid;
  gap: 3px 6px;
}
.pt-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 5.6px;
  font-weight: 600;
  color: #333;
  text-transform: uppercase;
  letter-spacing: 0.2px;
  cursor: pointer;
  user-select: none;
  min-width: 0;
}
.pt-item.pt-misc { grid-column: span 2; }
.pt-inline-input {
  flex: 1 1 0;
  min-width: 0;
  height: 10px;
  font-size: 6.5px;
  font-family: Helvetica, Arial, sans-serif;
  border: 1px solid #CFCFCF;
  border-radius: 1px;
  padding: 0 3px;
  outline: none;
  background: #fff;
  color: #1A1A1A;
  text-transform: none;
  -webkit-appearance: none;
  appearance: none;
}
.pt-inline-input:focus {
  border-color: #2D6E38;
  box-shadow: 0 0 0 1px #2D6E38;
}
.pt-inline-input::placeholder { color: #bbb; }

/* Sections */
.section {
  display: flex;
  flex-direction: column;
  border-bottom: 1px solid #E4E4E4;
}
.section-bar {
  height: 11px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  font-size: 5.4px;
  font-weight: 700;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.45px;
}
.section-bar.gray  { background: #4A4A4A; }
.section-bar.green { background: #2D6E38; }

.section-fields {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px 4px;
  height: 26px;
}
.section-fields.gray  { background: #F2F2F2; }
.section-fields.green { background: #EAF4EB; }
.section-fields input.inp { height: 11px; font-size: 7.5px; }
.section-fields.green input.inp {
  background: #fff;
  border-color: #AACFAD;
}

.charge-boxes {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 11px;
}
.charge-boxes .yn {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 6px;
  font-weight: 700;
  color: #333;
  cursor: pointer;
  user-select: none;
}

/* Footer */
.slip .footer {
  height: 16px;
  background: #1F4E28;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  padding: 0 12px;
}
.footer-text {
  color: #c8e6cc;
  font-size: 5.8px;
  font-weight: 500;
  letter-spacing: 0.4px;
}
.footer-brand {
  color: #8ab890;
  font-size: 5.6px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* Perf line */
.perf-line {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 0;
  color: #999;
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}
.perf-line::before,
.perf-line::after {
  content: "";
  flex: 1;
  border-top: 2px dashed #ccc;
}
.perf-line .scissors {
  font-size: 12px;
  line-height: 1;
  color: #aaa;
}

/* Screen: hide team ticket */
#slip-team { display: none; }

/* ================================================
   SCREEN OVERRIDES — bigger/more readable on-screen.
   ================================================ */
@media screen {
  .slip {
    height: auto;
    border-radius: 4px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
  }
  .slip .header {
    height: 72px;
    border-bottom-width: 4px;
  }
  .header-left { padding: 0 22px; gap: 16px; }
  .header-right { padding: 0 22px; gap: 14px; }
  .vine-logo { gap: 12px; }
  .vine-logo svg { height: 46px; }
  .vine-logo-img { height: 56px; max-width: 240px; }
  .vine-logo-text .brand { font-size: 22px; letter-spacing: 2.8px; }
  .vine-logo-text .brand-sub { font-size: 10px; letter-spacing: 2.2px; margin-top: 3px; }
  .header-divider { height: 36px; }
  .header-title { font-size: 18px; letter-spacing: 0.8px; }
  .slip-badge { font-size: 12px; padding: 6px 14px; letter-spacing: 0.9px; border-radius: 3px; }
  .receipt-num { font-size: 16px; letter-spacing: 0.5px; }
  .header-required { font-size: 12px; letter-spacing: 0.4px; }

  .row {
    padding: 10px 22px;
    gap: 14px;
    border-bottom-width: 1px;
  }
  .row.fields-row { height: auto; min-height: 58px; }
  .row.checkbox-row {
    padding: 14px 22px;
    gap: 16px;
    height: auto !important;
  }
  .field { gap: 5px; }
  .field label {
    font-size: 11px;
    letter-spacing: 0.6px;
    line-height: 1.2;
  }

  input.inp {
    height: 34px;
    font-size: 14px;
    padding: 0 10px;
    border-radius: 3px;
  }

  input.cbox {
    width: 18px;
    height: 18px;
    border-radius: 2px;
    border-width: 1.5px;
  }
  input.cbox:checked::after {
    left: 4px;
    top: 0px;
    width: 7px;
    height: 12px;
    border-width: 0 2.5px 2.5px 0;
  }

  .pt-label {
    flex: 0 0 110px;
    font-size: 11px;
    letter-spacing: 0.6px;
    padding-top: 4px;
    line-height: 1.3;
  }
  .pt-grid { gap: 10px 18px; }
  .pt-item {
    gap: 8px;
    font-size: 12px;
    letter-spacing: 0.3px;
  }
  .pt-inline-input {
    height: 26px;
    font-size: 13px;
    padding: 0 8px;
    border-radius: 2px;
  }

  .section-bar {
    height: 28px;
    padding: 0 22px;
    font-size: 11px;
    letter-spacing: 0.8px;
  }
  .section-fields {
    height: auto;
    min-height: 54px;
    padding: 10px 22px 12px;
    gap: 14px;
  }
  .section-fields input.inp {
    height: 30px;
    font-size: 13px;
  }

  .charge-boxes {
    height: auto;
    gap: 14px;
    padding-top: 4px;
  }
  .charge-boxes .yn {
    gap: 6px;
    font-size: 13px;
  }

  .slip .footer {
    height: 36px;
    padding: 0 22px;
  }
  .footer-text { font-size: 12px; letter-spacing: 0.5px; }
  .footer-brand { font-size: 12px; letter-spacing: 1.4px; }

  .perf-line {
    font-size: 13px;
    padding: 28px 0;
    gap: 14px;
    letter-spacing: 1px;
  }
  .perf-line .scissors { font-size: 20px; }
  .perf-line::before,
  .perf-line::after { border-top-width: 2px; }
}

/* ================================================
   PRINT — exact dimensions for micro-perf paper.
   All size overrides already satisfied by base CSS.
   ================================================ */
@page {
  size: letter portrait;
  margin: 0.25in 0.25in;
}
@media print {
  html, body {
    background: #fff;
    padding: 0;
    margin: 0;
    min-height: 0;
  }
  body { padding: 0; display: block; min-height: 0; }
  .app-nav, .controls, .toast { display: none !important; }
  .page-body {
    padding: 0 !important;
    margin: 0 !important;
    max-width: none !important;
    width: 100% !important;
    gap: 0 !important;
  }
  .page {
    width: 8.0in;
    height: 10.5in;
    padding: 0;
    margin: 0;
    border: none;
    box-shadow: none;
    background: transparent;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: stretch;
    gap: 0;
  }
  .perf-line { display: none; }
  #slip-team { display: flex; }
  .slip {
    width: 8.0in;
    height: 2.88in;
    flex-shrink: 0;
    border-color: #aaa;
    border-radius: 0;
    box-shadow: none;
    page-break-inside: avoid;
    break-inside: avoid;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .slip, .slip * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
}
