/* ═══════════════════════════════════════════════════════════
   FISH ON B2B — style.css
   ═══════════════════════════════════════════════════════════ */
:root {
  --black:    #1A1A1A;
  --red:      #E00448;
  --red-dk:   #b8003a;
  --grey:     #F2F2F2;
  --border:   #e0e0e0;
  --muted:    #888;
  --white:    #ffffff;
  --header-h: 56px;
  --tabs-h:   46px;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: 'Inter','Calibri',Arial,sans-serif; background: #f5f6f8; color: var(--black); font-size: 14px; line-height: 1.5; }
a { color: var(--red); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Logo ── */
.logo-fish { font-weight: 900; font-size: 20px; color: var(--red); letter-spacing: 1px; }
.logo-on   { font-weight: 900; font-size: 20px; color: #fff; letter-spacing: 1px; }

/* ── Header ── */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--black); height: var(--header-h);
  border-bottom: 2px solid var(--red);
}
.header-inner {
  max-width: 1600px; margin: 0 auto; padding: 0 20px;
  height: 100%; display: flex; align-items: center; justify-content: space-between;
}
.logo { display: flex; align-items: baseline; gap: 8px; text-decoration: none; }
.logo-sub { font-size: 11px; color: #aaa; font-weight: 400; }
.header-nav { display: flex; align-items: center; gap: 12px; }
.client-name { color: #ccc; font-size: 13px; }
.nav-link { font-size: 13px; color: #aaa; transition: color .15s; white-space: nowrap; }
.nav-link:hover { color: #fff; text-decoration: none; }
.btn-logout {
  font-size: 12px; color: #aaa; border: 1px solid #444;
  padding: 4px 12px; border-radius: 4px; transition: all .15s; white-space: nowrap;
}
.btn-logout:hover { color: #fff; border-color: #888; text-decoration: none; }

/* ── Header order total + button ── */
.header-total-wrap {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.06);
  border: 1px solid #333;
  border-radius: 6px;
  padding: 4px 6px 4px 12px;
}
.header-total {
  font-size: 18px; font-weight: 900; color: #E00448 !important;
  min-width: 80px; text-align: right; white-space: nowrap;
}
.header-count {
  font-size: 11px; color: #bbb !important; white-space: nowrap;
}
.header-order-btn {
  background: var(--red); color: #fff;
  font-size: 13px; font-weight: 900; letter-spacing: .5px;
  border: none; border-radius: 4px;
  padding: 7px 16px; cursor: pointer;
  font-family: inherit; transition: background .15s;
  white-space: nowrap;
}
.header-order-btn:hover:not(:disabled) { background: var(--red-dk); }
.header-order-btn:disabled { background: #333; color: #555; cursor: not-allowed; }

/* ── Shared buttons ── */
.btn-primary { display: inline-block; background: var(--red); color: #fff; font-size: 14px; font-weight: 700; padding: 10px 20px; border: none; border-radius: 6px; cursor: pointer; font-family: inherit; transition: background .15s; text-decoration: none; text-align: center; }
.btn-primary:hover { background: var(--red-dk); text-decoration: none; color: #fff; }
.btn-outline { display: inline-block; background: transparent; color: #aaa; font-size: 14px; font-weight: 500; padding: 10px 20px; border: 1px solid #444; border-radius: 6px; cursor: pointer; font-family: inherit; transition: all .15s; text-decoration: none; text-align: center; }
.btn-outline:hover { color: #fff; border-color: #888; text-decoration: none; }
.btn-full { width: 100%; display: block; }

/* ── Tabs ── */
.tabs-outer {
  position: sticky; top: var(--header-h); z-index: 90;
  background: var(--black); border-bottom: 1px solid #333; width: 100%;
}
.tabs-scroll { overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.tabs-scroll::-webkit-scrollbar { display: none; }
.tabs { display: flex; padding: 0 16px; gap: 2px; min-width: max-content; }
.tab {
  position: relative; background: none;
  border: none; border-bottom: 3px solid transparent;
  color: #aaa; font-size: 13px; font-weight: 500;
  padding: 0 14px; height: var(--tabs-h);
  cursor: pointer; white-space: nowrap;
  transition: color .15s; font-family: inherit;
}
.tab:hover { color: #fff; }
.tab.active { color: #fff; border-bottom-color: var(--red); }
.tab.tab-has-items { color: #fff; }
.tab-badge {
  background: var(--red); color: #fff; font-size: 10px; font-weight: 700;
  padding: 1px 5px; border-radius: 10px; margin-left: 4px;
  vertical-align: middle; line-height: 14px;
}

/* ── Catalog ── */
.order-page { padding: 0; }
.catalog-wrap { padding: 12px 16px 60px; }
.sheet-pane { display: none; }
.sheet-pane.active { display: block; }

.catalog-table {
  width: 100%; border-collapse: collapse; background: #fff;
  border-radius: 8px; overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,.06); table-layout: fixed;
}
.catalog-table thead tr { background: var(--black); color: #fff; }
.catalog-table thead th {
  padding: 10px 8px; font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .5px;
  text-align: left; white-space: nowrap; overflow: hidden;
}

/* Column widths */
.col-code   { width: 105px; }
.col-name   { width: auto; }
.col-pkg    { width: 80px;  text-align: center !important; }
.col-price  { width: 105px; text-align: right !important; }
.col-retail { width: 90px;  text-align: right !important; }
.col-qty    { width: 78px;  text-align: center !important; }
.col-sum    { width: 90px;  text-align: right !important; font-weight: 600; }

.catalog-table tbody tr.row-product { border-bottom: 1px solid #f0f0f0; transition: background .1s; }
.catalog-table tbody tr.row-product:hover { background: #fafafa; }
.catalog-table tbody tr.row-product.row-selected { background: #fff5f7; }
.catalog-table tbody tr.row-unavailable td { opacity: .4; }
.catalog-table tbody td {
  padding: 7px 8px; font-size: 13px; vertical-align: middle;
  overflow: hidden; text-overflow: ellipsis;
}
.col-price, .col-retail, .col-sum { text-align: right; }
.col-pkg, .col-qty { text-align: center; }
.col-code { color: var(--muted); font-size: 12px; font-family: monospace; white-space: nowrap; }
.col-name { white-space: normal; word-break: break-word; }

.row-category td {
  background: var(--grey); font-weight: 700; font-size: 12px;
  padding: 6px 8px; color: #333; text-transform: uppercase;
  letter-spacing: .5px; border-top: 2px solid var(--border);
}

/* Flags */
.flag-tag { display: inline-block; font-size: 9px; font-weight: 700; padding: 2px 5px; border-radius: 3px; vertical-align: middle; margin-right: 4px; letter-spacing: .5px; white-space: nowrap; }
.tag-new     { background: var(--red); color: #fff; }
.tag-arriving{ background: #1565c0; color: #fff; }
.tag-unavail { background: #555; color: #fff; }
.foto-link   { font-size: 11px; margin-left: 4px; opacity: .6; text-decoration: none; }
.foto-link:hover { opacity: 1; }

/* Qty input */
.qty-input {
  width: 60px; padding: 5px 4px; border: 1px solid var(--border);
  border-radius: 4px; font-size: 14px; font-family: inherit;
  text-align: center; transition: border-color .15s, box-shadow .15s; background: #fafafa;
}
.qty-input:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 2px rgba(224,4,72,.15); background: #fff; }
.row-selected .qty-input { border-color: var(--red); background: #fff; }

/* ── Modals ── */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.65); z-index: 200; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal { background: #242424; border-radius: 10px; box-shadow: 0 8px 40px rgba(0,0,0,.5); max-width: 700px; width: 100%; max-height: 90vh; display: flex; flex-direction: column; border: 1px solid #333; }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid #333; flex-shrink: 0; }
.modal-title { font-size: 17px; font-weight: 700; color: #fff; }
.modal-close { background: none; border: none; color: #888; font-size: 18px; cursor: pointer; padding: 0; line-height: 1; }
.modal-close:hover { color: #fff; }
.modal-body { overflow-y: auto; padding: 16px 20px; flex: 1; }
.modal-footer { padding: 14px 20px; border-top: 1px solid #333; display: flex; justify-content: flex-end; gap: 10px; flex-shrink: 0; }
.btn-confirm { font-size: 15px; font-weight: 900; padding: 12px 28px; }
.summary-sheet { background: var(--black); color: #fff; font-size: 11px; font-weight: 700; padding: 6px 10px; margin-top: 10px; border-radius: 4px 4px 0 0; letter-spacing: .5px; text-transform: uppercase; }
.summary-table { width: 100%; border-collapse: collapse; font-size: 13px; border: 1px solid #333; border-top: none; margin-bottom: 2px; }
.summary-table td { padding: 6px 10px; border-bottom: 1px solid #2a2a2a; vertical-align: middle; color: #ddd; }
.s-code  { width: 110px; color: var(--muted) !important; font-family: monospace; font-size: 12px; }
.s-qty   { width: 60px; text-align: center; color: var(--muted) !important; white-space: nowrap; }
.s-total { width: 90px; text-align: right; font-weight: 600; white-space: nowrap; color: #fff !important; }
.summary-total { background: var(--black); color: var(--red); text-align: right; padding: 10px; font-size: 18px; font-weight: 900; border-radius: 0 0 4px 4px; margin-bottom: 4px; }
.summary-total span { font-size: 22px; }
.comment-section { margin-top: 16px; }
.comment-label { display: block; font-size: 12px; color: #aaa; margin-bottom: 6px; font-weight: 500; }
.comment-input { width: 100%; background: #1a1a1a; border: 1px solid #444; border-radius: 6px; color: #fff; font-size: 14px; padding: 10px 12px; font-family: inherit; resize: vertical; min-height: 80px; }
.comment-input:focus { outline: none; border-color: var(--red); }

/* ── Auth pages ── */
.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--black); padding: 20px; }
.auth-wrap { width: 100%; display: flex; justify-content: center; }
.auth-card { background: #242424; border: 1px solid #333; border-radius: 10px; padding: 36px 32px; width: 100%; max-width: 420px; box-shadow: 0 8px 32px rgba(0,0,0,.4); }
.auth-card-wide { max-width: 680px; }
.auth-logo { text-align: center; margin-bottom: 6px; font-size: 34px; font-weight: 900; }
.auth-logo .logo-fish { color: var(--red); }
.auth-logo .logo-on   { color: #fff; }
.auth-subtitle { text-align: center; color: #888; font-size: 12px; margin-bottom: 24px; }
.alert-error { background: rgba(224,4,72,.1); border: 1px solid rgba(224,4,72,.4); color: #ff6b8a; padding: 10px 14px; border-radius: 6px; margin-bottom: 16px; font-size: 13px; }
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-divider { text-align: center; color: #555; font-size: 12px; margin: 8px 0; position: relative; }
.auth-divider::before, .auth-divider::after { content: ''; position: absolute; top: 50%; width: 42%; height: 1px; background: #333; }
.auth-divider::before { left: 0; } .auth-divider::after { right: 0; }
.auth-footer { text-align: center; color: #666; font-size: 11px; margin-top: 16px; }
.auth-footer a { color: #aaa; }

/* ── Form fields ── */
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 12px; color: #aaa; font-weight: 500; }
.field input, .field select, .field textarea { background: #1a1a1a; border: 1px solid #444; border-radius: 6px; color: #fff; font-size: 14px; padding: 9px 12px; font-family: inherit; transition: border-color .15s; width: 100%; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--red); }
.field input::placeholder, .field textarea::placeholder { color: #555; }
.field-error input, .field-error select { border-color: rgba(224,4,72,.6); }
.field-msg { font-size: 11px; color: #ff6b8a; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px,1fr)); gap: 12px; }
.form-section-title { font-size: 11px; font-weight: 700; color: #888; text-transform: uppercase; letter-spacing: .8px; border-bottom: 1px solid #333; padding-bottom: 6px; margin-top: 4px; }

/* ── Other pages ── */
.page-main { padding: 0; }
.page-center { min-height: 80vh; display: flex; align-items: flex-start; justify-content: center; padding: 32px 16px 60px; }
.page-padded { max-width: 1000px; margin: 0 auto; padding: 24px 20px 60px; }
.page-header-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.page-title { font-size: 20px; font-weight: 700; }
.card { background: #fff; border-radius: 10px; padding: 32px 28px; width: 100%; max-width: 760px; box-shadow: 0 2px 12px rgba(0,0,0,.08); }
.meta-box { background: var(--grey); border-radius: 8px; padding: 16px 20px; margin-bottom: 20px; }
.meta-row { display: flex; justify-content: space-between; padding: 5px 0; font-size: 14px; border-bottom: 1px solid #e0e0e0; }
.meta-row:last-child { border-bottom: none; }
.meta-row span { color: var(--muted); }
.empty-state { text-align: center; padding: 60px 20px; color: var(--muted); }
.history-card { background: #fff; border-radius: 8px; margin-bottom: 12px; box-shadow: 0 1px 4px rgba(0,0,0,.06); overflow: hidden; }
.history-header { display: flex; justify-content: space-between; align-items: center; padding: 14px 20px; cursor: pointer; transition: background .1s; }
.history-header:hover { background: #fafafa; }
.history-meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.history-num { font-weight: 700; color: var(--muted); font-family: monospace; }
.history-date { color: var(--muted); font-size: 13px; }
.history-right { display: flex; align-items: center; gap: 12px; }
.history-total { font-size: 18px; font-weight: 900; color: var(--red); }
.toggle-icon { color: var(--muted); font-size: 12px; }
.history-body { padding: 0 20px 16px; border-top: 1px solid #f0f0f0; }
.comment-display { background: #f9f9f9; border-left: 3px solid var(--red); padding: 8px 12px; margin: 12px 0; font-size: 13px; color: #555; }
.status-badge { display: inline-block; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 12px; white-space: nowrap; }
.status-new         { background: #fff3cd; color: #856404; }
.status-processing  { background: #cce5ff; color: #004085; }
.status-completed   { background: #d4edda; color: #155724; }
.status-cancelled   { background: #f8d7da; color: #721c24; }
.status-client-pending  { background: #fff3cd; color: #856404; }
.status-client-active   { background: #d4edda; color: #155724; }
.status-client-disabled { background: #e2e3e5; color: #383d41; }
.status-client-rejected { background: #f8d7da; color: #721c24; }

/* Summary in success/history */
.summary-sheet { background: var(--black); color: #fff; font-size: 11px; font-weight: 700; padding: 6px 12px; margin-top: 12px; border-radius: 4px 4px 0 0; letter-spacing: .5px; text-transform: uppercase; }
.summary-table { width: 100%; border-collapse: collapse; font-size: 13px; border: 1px solid var(--border); border-top: none; }
.summary-table td { padding: 6px 12px; border-bottom: 1px solid #f0f0f0; vertical-align: middle; }
.s-code  { width: 110px; color: var(--muted); font-family: monospace; font-size: 12px; }
.s-qty   { width: 60px; text-align: center; color: var(--muted); white-space: nowrap; }
.s-total { width: 90px; text-align: right; font-weight: 600; white-space: nowrap; }

/* ── Responsive ── */
@media (max-width: 960px) {
  .header-count { display: none; }
  .header-total { font-size: 16px; min-width: 60px; }
  .col-retail { display: none; }
  .col-pkg    { display: none; }
  .catalog-table tbody td, .catalog-table thead th { padding: 6px 5px; }
  .qty-input { width: 52px; }
}
@media (max-width: 640px) {
  .client-name { display: none; }
  .col-code { display: none; }
  .catalog-table tbody td, .catalog-table thead th { font-size: 12px; padding: 5px 4px; }
  .header-total-wrap { padding: 3px 4px 3px 8px; gap: 5px; }
  .header-total { font-size: 15px; min-width: 50px; }
  .header-order-btn { padding: 6px 10px; font-size: 12px; }
}
