/* ── LITTLE STREET КП — Brand CSS ─────────────────────────────────────────── */
:root {
  --bg:      #FEF2E3;
  --yellow:  #FECE47;
  --coral:   #F5A691;
  --black:   #1D1D1B;
  --dark:    #2C2C2A;
  --mid:     #555550;
  --soft:    #9B958A;
  --white:   #FFFFFF;
  --border:  #E8DFCF;
  --card:    #FFFDF8;
  --red:     #E05050;
  --green:   #4CAF7D;
  --font:    'Century Gothic', 'Nunito', 'Trebuchet MS', sans-serif;
  --radius:  12px;
  --shadow:  0 4px 24px rgba(29,29,27,.08);
}

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

html { font-size: 15px; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--black);
  min-height: 100vh;
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }

/* ── NAVBAR ──────────────────────────────────────────────────────────────── */
.navbar {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 32px;
  height: 64px;
  background: var(--white);
  border-bottom: 2px solid var(--yellow);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,.06);
}
.nav-logo img { display: block; }
.nav-links { display: flex; gap: 4px; flex: 1; }
.nav-link {
  padding: 6px 14px;
  border-radius: 8px;
  font-weight: 600;
  color: var(--mid);
  transition: background .15s, color .15s;
}
.nav-link:hover, .nav-link.active { background: var(--bg); color: var(--black); }
.nav-right { display: flex; align-items: center; gap: 16px; margin-left: auto; }
.nav-user { display: flex; align-items: center; gap: 12px; }
.user-name { font-weight: 700; color: var(--black); }
.logout { font-size: .85rem; color: var(--soft); }
.logout:hover { color: var(--red); }

/* ── BUTTONS ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 20px;
  border-radius: 8px;
  font-family: var(--font);
  font-size: .9rem;
  font-weight: 700;
  cursor: pointer;
  border: 2px solid transparent;
  transition: opacity .15s, transform .1s, box-shadow .15s;
  white-space: nowrap;
}
.btn:hover { opacity: .88; }
.btn:active { transform: scale(.97); }

.btn-yellow  { background: var(--yellow); color: var(--black); }
.btn-yellow:hover { box-shadow: 0 4px 16px rgba(254,206,71,.4); }
.btn-outline  { background: transparent; border-color: var(--border); color: var(--dark); }
.btn-outline:hover { border-color: var(--dark); background: var(--bg); }
.btn-ghost    { background: transparent; color: var(--mid); border-color: transparent; }
.btn-ghost:hover { background: var(--bg); color: var(--black); }
.btn-sm       { padding: 5px 12px; font-size: .82rem; }
.btn-lg       { padding: 13px 28px; font-size: 1rem; }
.btn-full     { width: 100%; justify-content: center; }
.btn-full-w   { width: 100%; justify-content: center; margin-top: 8px; }
.btn-dashed   { border: 2px dashed var(--border); background: transparent; color: var(--soft); }
.btn-dashed:hover { border-color: var(--dark); color: var(--black); background: var(--bg); }

/* ── FLASH ───────────────────────────────────────────────────────────────── */
.flash-wrap { padding: 12px 32px 0; }
.flash {
  background: var(--coral);
  color: var(--white);
  padding: 12px 20px;
  border-radius: 8px;
  font-weight: 600;
  margin-bottom: 8px;
}

/* ── MAIN LAYOUT ─────────────────────────────────────────────────────────── */
.main-content { max-width: 1200px; margin: 0 auto; padding: 32px; }

/* ── PAGE HEADER ─────────────────────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 28px;
}
.page-title { font-size: 1.8rem; font-weight: 800; color: var(--black); }
.page-sub   { font-size: .9rem; color: var(--soft); margin-top: 4px; }

/* ── SEARCH ──────────────────────────────────────────────────────────────── */
.search-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
}
.search-input {
  flex: 1;
  max-width: 400px;
  padding: 10px 16px;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-family: var(--font);
  font-size: .9rem;
  background: var(--white);
  color: var(--black);
  outline: none;
}
.search-input:focus { border-color: var(--yellow); }

/* ── TABLE ───────────────────────────────────────────────────────────────── */
.kp-table-wrap {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: visible;
}
.kp-table { border-radius: var(--radius); overflow: hidden; }
.kp-table { width: 100%; border-collapse: collapse; }
.kp-table thead th {
  background: #675C55;
  color: var(--white);
  padding: 13px 16px;
  text-align: left;
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.kp-table tbody tr { border-bottom: 1px solid var(--border); transition: background .1s; }
.kp-table tbody tr:last-child { border-bottom: none; }
.kp-table tbody tr:hover { background: var(--bg); cursor: pointer; }
.kp-table td { padding: 14px 16px; vertical-align: middle; }

.kp-num   { font-weight: 700; color: var(--dark); font-size: .85rem; }
.kp-client { }
.client-name { font-weight: 600; display: block; }
.client-contact { font-size: .82rem; color: var(--soft); }
.kp-sum   { font-weight: 700; font-size: 1rem; }
.kp-date  { color: var(--soft); font-size: .85rem; white-space: nowrap; }
.kp-actions { text-align: right; white-space: nowrap; }
.action-link, .action-btn {
  padding: 4px 8px;
  background: none;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  border-radius: 6px;
  transition: background .1s;
}
.action-link:hover, .action-btn:hover { background: var(--bg); }
.action-btn.del:hover { background: #fde8e8; }

/* ── BADGES ──────────────────────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: .78rem;
  font-weight: 700;
}
.badge-draft    { background: #EEE; color: #666; }
.badge-sent     { background: #FFF3C4; color: #8A6800; }
.badge-accepted { background: #D4EDDA; color: #1B6A38; }
.badge-rejected { background: #FFE0DC; color: #9B2E24; }

/* ── STATUS MENU ─────────────────────────────────────────────────────────── */
.status-menu-wrap { position: relative; display: inline-block; }
.status-menu {
  position: fixed;
  z-index: 9999;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,.15);
  flex-direction: column;
  min-width: 160px;
  padding: 4px;
}
.status-option {
  display: block;
  width: 100%;
  padding: 9px 14px;
  text-align: left;
  border: none;
  background: none;
  font-family: var(--font);
  font-size: .88rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: 6px;
  transition: background .1s;
}
.status-option:hover   { background: var(--bg); }
.status-option.active  { font-weight: 800; }
.status-opt-draft      { color: #666; }
.status-opt-sent       { color: #8A6800; }
.status-opt-in_work    { color: #1a5fa8; }
.status-opt-accepted   { color: #1B6A38; }
.status-opt-rejected   { color: #9B2E24; }

.badge-lg { font-size: .88rem; padding: 5px 14px; }
.badge-btn { cursor: pointer; user-select: none; }
.badge-in_work { background: #D6E8FF; color: #1a5fa8; }

/* ── EMPTY STATE ─────────────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--soft);
}
.empty-icon { font-size: 3rem; margin-bottom: 16px; }
.empty-state p { margin-bottom: 20px; font-size: 1.05rem; }

/* ── LOGIN ───────────────────────────────────────────────────────────────── */
.login-page {
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}
.login-wrap { width: 100%; max-width: 420px; padding: 24px; }
.login-card {
  background: var(--white);
  border-radius: 20px;
  padding: 40px;
  box-shadow: var(--shadow);
}
.login-logo { text-align: center; margin-bottom: 24px; }
.login-title { font-size: 1.4rem; font-weight: 800; text-align: center; margin-bottom: 6px; }
.login-sub   { text-align: center; color: var(--soft); font-size: .9rem; margin-bottom: 28px; }
.login-form  { display: flex; flex-direction: column; gap: 18px; }

/* ── FIELDS ──────────────────────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: .82rem; font-weight: 700; color: var(--mid); text-transform: uppercase; letter-spacing: .04em; }
.field input, .field select, .field textarea {
  padding: 11px 14px;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-family: var(--font);
  font-size: .95rem;
  color: var(--black);
  background: var(--white);
  outline: none;
  transition: border-color .15s;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--yellow); }
.field textarea { resize: vertical; }
.fields-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
.field-wide { grid-column: span 2; }

/* ── CARD ────────────────────────────────────────────────────────────────── */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
  margin-bottom: 20px;
}
.card-title { font-size: 1.1rem; font-weight: 800; margin-bottom: 20px; color: var(--dark); }
.card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

/* ── FORM PAGE ───────────────────────────────────────────────────────────── */
.form-page { max-width: 1100px; }
.form-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.form-header-actions { display: flex; gap: 10px; }
.form-bottom-actions {
  display: flex;
  gap: 12px;
  margin-top: 8px;
  margin-bottom: 40px;
}

/* ── ITEMS TABLE ─────────────────────────────────────────────────────────── */
.items-wrap { overflow-x: auto; margin-bottom: 0; }
.items-table { width: 100%; border-collapse: collapse; }
.items-table thead th {
  background: #675C55;
  color: var(--white);
  padding: 10px 12px;
  text-align: left;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  white-space: nowrap;
}
.items-table tbody tr { border-bottom: 1px solid var(--border); }
.items-table tbody tr:hover { background: #FFFBF4; }
.items-table td { padding: 10px 12px; vertical-align: top; }

.col-num   { width: 36px; text-align: center; }
.col-photo { width: 80px; }
.col-name  { width: 180px; }
.col-desc  { }
.col-price { width: 120px; }
.col-qty   { width: 72px; }
.col-total { width: 120px; white-space: nowrap; }
.col-del   { width: 36px; }

.idx-num { font-weight: 700; color: var(--mid); font-size: .9rem; text-align: center; }

.item-row input[type=text], .item-row input[type=number], .item-row textarea {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  padding: 7px 10px;
  font-family: var(--font);
  font-size: .88rem;
  background: var(--white);
  color: var(--black);
  outline: none;
  transition: border-color .15s;
}
.item-row input:focus, .item-row textarea:focus { border-color: var(--yellow); }
.item-row textarea { resize: vertical; min-height: 58px; }

.item-total { font-weight: 700; font-size: .95rem; white-space: nowrap; }

.del-btn {
  width: 28px; height: 28px;
  background: none;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  color: var(--soft);
  font-size: .9rem;
  transition: background .1s, color .1s;
}
.del-btn:hover { background: #fde8e8; color: var(--red); }

/* ── PHOTO UPLOAD ────────────────────────────────────────────────────────── */
.photo-cell { display: flex; flex-direction: column; align-items: center; }
.photo-thumb {
  width: 60px; height: 60px;
  border: 2px dashed var(--border);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
  transition: border-color .15s;
  background: var(--bg);
}
.photo-thumb:hover { border-color: var(--dark); }
.photo-placeholder { font-size: 1.4rem; color: var(--soft); }
.photo-img { width: 100%; height: 100%; object-fit: cover; }
.photo-uploading { opacity: .5; }

/* ── TOTALS ──────────────────────────────────────────────────────────────── */
.totals-card { }
.totals-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }
.totals-left { display: flex; flex-direction: column; gap: 18px; }
.totals-right { display: flex; flex-direction: column; gap: 0; }
.total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
  font-size: .95rem;
}
.total-row:last-child { border-bottom: none; }
.total-row strong { font-weight: 700; }
.discount-row { color: var(--coral); }
.total-final {
  background: #675C55;
  color: var(--white);
  border-radius: 8px;
  padding: 14px 16px;
  margin-top: 8px;
  font-weight: 800;
  font-size: 1.05rem;
}
.total-final strong { font-size: 1.1rem; }

/* ── VIEW PAGE ───────────────────────────────────────────────────────────── */
.view-page { }
.view-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 12px;
}
.view-actions-left, .view-actions-right { display: flex; align-items: center; gap: 10px; }
.kp-number-badge {
  background: var(--yellow);
  color: var(--black);
  padding: 5px 14px;
  border-radius: 20px;
  font-weight: 800;
  font-size: .9rem;
}

/* ── KP DOCUMENT ─────────────────────────────────────────────────────────── */
.kp-doc {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  max-width: 960px;
}

.doc-header {
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 28px 36px;
  background: var(--bg);
  border-bottom: 3px solid var(--yellow);
}
.doc-logo img { display: block; }
.doc-kp-label { font-size: 1.4rem; font-weight: 800; color: var(--black); letter-spacing: .02em; }
.doc-kp-sub   { font-size: .9rem; color: var(--mid); margin-top: 4px; }
.doc-meta     { display: flex; gap: 16px; margin-top: 10px; font-size: .82rem; color: var(--soft); }

.doc-client {
  padding: 16px 36px;
  background: #FFFEF5;
  border-bottom: 1px solid var(--border);
  font-size: .95rem;
}

/* GREETING BLOCK */
.doc-greeting {
  display: flex;
  align-items: flex-end;
  gap: 0;
  border-bottom: 1px solid var(--border);
  background: var(--white);
  overflow: hidden;
}
.greeting-content {
  flex: 1;
  padding: 28px 28px 28px 36px;
}
.greeting-salutation {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--black);
  margin-bottom: 12px;
}
.greeting-body {
  font-size: .95rem;
  color: var(--mid);
  line-height: 1.75;
  margin-bottom: 8px;
}
.greeting-body strong { color: var(--black); }
.greeting-manager {
  margin-top: 14px;
  font-size: .9rem;
  color: var(--soft);
}
.greeting-manager strong { color: var(--dark); }
.greeting-mascot {
  flex-shrink: 0;
  display: flex;
  align-items: flex-end;
  padding-right: 12px;
}
.greeting-mascot img {
  width: auto;
  height: 160px;
  display: block;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,.08));
}

/* DOC ITEMS TABLE */
.doc-items { width: 100%; border-collapse: collapse; }
.doc-items thead th {
  background: #675C55;
  color: var(--white);
  padding: 12px 16px;
  text-align: left;
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.doc-items tbody tr { border-bottom: 1px solid var(--border); }
.doc-items tbody tr:nth-child(even) { background: #FDFAF4; }
.doc-items td { padding: 14px 16px; vertical-align: top; font-size: .9rem; }
.doc-num   { width: 36px; text-align: center; font-weight: 700; color: var(--mid); }
.doc-photo { width: 80px; }
.doc-photo img { width: 64px; height: 64px; object-fit: cover; border-radius: 6px; }
.no-photo { width: 64px; height: 64px; background: var(--bg); border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: 1.4rem; color: var(--border); }
.doc-name  { font-weight: 700; }
.doc-desc  { color: var(--mid); font-size: .85rem; white-space: pre-line; }
.doc-price, .doc-qty, .doc-total { white-space: nowrap; text-align: right; }
.doc-total { font-weight: 700; }

/* DOC TOTALS */
.doc-totals {
  padding: 20px 36px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0;
  border-top: 2px solid var(--border);
}
.doc-total-row {
  display: flex;
  justify-content: space-between;
  width: 340px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  font-size: .95rem;
}
.doc-total-row:last-child { border-bottom: none; }
.doc-disc { color: var(--coral); }
.doc-grand-total {
  background: #675C55;
  color: var(--white);
  border-radius: 8px;
  padding: 14px 20px;
  margin-top: 10px;
  font-weight: 800;
  font-size: 1.1rem;
  width: 340px;
}

/* DOC FOOTER INFO */
.doc-footer-info {
  padding: 20px 36px;
  border-top: 1px solid var(--border);
  background: #FFFEF8;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.doc-footer-row { font-size: .9rem; color: var(--dark); line-height: 1.6; }

/* DOC MANAGER FOOTER */
.doc-manager-footer {
  background: var(--coral);
  padding: 24px 36px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.manager-label { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; opacity: .7; margin-bottom: 4px; }
.manager-name  { font-size: 1.1rem; font-weight: 800; }
.manager-contact { font-size: .88rem; margin-top: 3px; opacity: .85; }
.manager-brand { text-align: right; }
.brand-tagline { font-size: .78rem; color: var(--dark); opacity: .7; margin-top: 4px; }

/* CORAL FOOTER (public) */
.doc-coral-footer {
  background: var(--coral);
  padding: 28px 36px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.coral-label   { font-size: .82rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; opacity: .65; margin-bottom: 4px; }
.coral-name    { font-size: .82rem; font-weight: 700; }
.coral-contact { font-size: .82rem; margin-top: 2px; }
.coral-tagline { font-size: .82rem; opacity: .65; margin-top: 6px; }
.coral-left    { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.coral-site {
  display: inline-block;
  margin-top: 6px;
  font-size: .85rem;
  font-weight: 700;
  color: var(--dark);
  text-decoration: underline;
  text-underline-offset: 3px;
  opacity: .85;
  transition: opacity .15s;
}
.coral-site:hover { opacity: 1; }

/* ── PUBLIC PAGE ─────────────────────────────────────────────────────────── */
.public-page { background: var(--bg); }
.public-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 32px;
  background: var(--white);
  border-bottom: 2px solid var(--yellow);
  margin-bottom: 32px;
}
.public-doc { margin: 0 auto 60px; max-width: 900px; }

/* ── COPY TOAST ──────────────────────────────────────────────────────────── */
.copy-toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  background: #675C55;
  color: var(--white);
  padding: 12px 24px;
  border-radius: 40px;
  font-weight: 700;
  font-size: .9rem;
  z-index: 9999;
  box-shadow: 0 8px 24px rgba(0,0,0,.2);
}

/* ── CATALOG ─────────────────────────────────────────────────────────────── */
.cat-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.cat-filter {
  padding: 7px 16px;
  border-radius: 20px;
  border: 2px solid var(--border);
  background: var(--white);
  font-family: var(--font);
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--mid);
  transition: all .15s;
}
.cat-filter:hover { border-color: var(--dark); color: var(--black); }
.cat-filter.active { background: #675C55; color: var(--white); border-color: var(--dark); }

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}
.cat-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow .15s, transform .15s;
}
.cat-card:hover { box-shadow: 0 8px 32px rgba(0,0,0,.12); transform: translateY(-2px); }
.cat-card-photo { aspect-ratio: 4/3; background: var(--bg); overflow: hidden; }
.cat-card-photo img { width: 100%; height: 100%; object-fit: cover; }
.cat-no-photo { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 2.5rem; color: var(--border); }
.cat-card-body { padding: 16px; flex: 1; }
.cat-category { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--coral); margin-bottom: 4px; }
.cat-name  { font-size: 1rem; font-weight: 800; color: var(--black); margin-bottom: 6px; }
.cat-desc  { font-size: .83rem; color: var(--mid); line-height: 1.5; margin-bottom: 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cat-price { font-size: 1.05rem; font-weight: 800; color: var(--dark); }
.cat-card-actions { padding: 10px 16px 14px; display: flex; gap: 8px; }

/* ── MODAL ───────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(29,29,27,.45);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-box {
  background: var(--white);
  border-radius: 16px;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 64px rgba(0,0,0,.2);
}
.modal-wide { max-width: 860px; height: 85vh; }
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
}
.modal-header h2 { font-size: 1.1rem; font-weight: 800; }
.modal-close { background: none; border: none; font-size: 1.2rem; cursor: pointer; color: var(--soft); padding: 4px 8px; border-radius: 6px; }
.modal-close:hover { background: var(--bg); color: var(--black); }
.modal-search { padding: 16px 24px 0; }
.modal-body { padding: 20px 24px; overflow-y: auto; flex: 1; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; gap: 10px; }

.photo-upload-row { display: flex; align-items: center; gap: 16px; }
.photo-hint { font-size: .82rem; color: var(--soft); }

/* PICKER */
.picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  padding: 16px;
  align-content: start;
}
.picker-loading { padding: 40px; text-align: center; color: var(--soft); grid-column: 1/-1; }
.picker-card {
  border: 2px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  background: var(--white);
  display: flex;
  flex-direction: column;
  transition: border-color .15s, box-shadow .15s, transform .1s;
}
.picker-card:hover { border-color: var(--yellow); box-shadow: 0 4px 16px rgba(254,206,71,.35); transform: translateY(-2px); }
.picker-photo {
  width: 100%;
  height: 130px;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: var(--border);
  overflow: hidden;
  flex-shrink: 0;
}
.picker-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.picker-info { padding: 10px 12px 12px; flex: 1; display: flex; flex-direction: column; gap: 3px; }
.picker-name { font-weight: 800; font-size: .88rem; color: var(--black); line-height: 1.3; }
.picker-desc { font-size: .76rem; color: var(--mid); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; flex: 1; }
.picker-price { font-weight: 800; font-size: .95rem; color: var(--dark); margin-top: 4px; }

/* ── RESPONSIVE ──────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .main-content { padding: 16px; }
  .fields-row { grid-template-columns: 1fr; }
  .field-wide { grid-column: span 1; }
  .totals-grid { grid-template-columns: 1fr; }
  .view-actions { flex-direction: column; align-items: flex-start; }
  .navbar { padding: 0 16px; gap: 12px; }
  .doc-header { flex-direction: column; align-items: flex-start; padding: 20px; }
  .doc-totals { padding: 16px 20px; }
  .doc-total-row, .doc-grand-total { width: 100%; }
  .kp-table { font-size: .82rem; }
  .kp-table td, .kp-table th { padding: 10px 8px; }
  .page-header { flex-direction: column; align-items: flex-start; gap: 12px; }
}

/* ── PRINT ───────────────────────────────────────────────────────────────── */
@media print {
  .no-print, .navbar, .view-actions, .form-header-actions, .form-bottom-actions { display: none !important; }
  body { background: white; }
  .kp-doc { box-shadow: none; }
  .main-content { padding: 0; max-width: none; }
}
