/* ═══════════════════════════════════════════
   SOLIMPE — CSS Compartilhado
   shared.css
═══════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&family=IBM+Plex+Sans:wght@300;400;500;600&display=swap');

:root {
  --mono: 'IBM Plex Mono', monospace;
  --sans: 'IBM Plex Sans', sans-serif;
  --radius: 8px;
}

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

body {
  font-family: var(--sans);
  min-height: 100vh;
  font-size: 14px;
}

/* ── LOGIN ── */
#loginScreen {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  z-index: 9999;
}
.login-box {
  background: #fff;
  border-radius: 12px;
  padding: 2.5rem 2rem;
  width: 340px;
  max-width: calc(100vw - 2rem);
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.login-logo {
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 4px;
}
.login-sub {
  font-size: 12px;
  margin-bottom: 1.8rem;
  font-family: var(--mono);
}
.login-lbl {
  display: block;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: 5px;
}
.login-inp {
  width: 100%;
  border-radius: 6px;
  font-family: var(--sans);
  font-size: 14px;
  padding: 10px 12px;
  outline: none;
  margin-bottom: 10px;
  transition: border-color .15s;
  border: 1px solid;
}
.login-btn {
  width: 100%;
  border: none;
  border-radius: 7px;
  color: #fff;
  cursor: pointer;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  padding: 12px;
  margin-top: 4px;
}
.login-err {
  border-radius: 6px;
  font-size: 12px;
  padding: 8px 10px;
  margin-top: 8px;
  display: none;
  font-family: var(--mono);
}

/* ── HEADER ── */
header {
  padding: 0 1.5rem;
  display: flex; align-items: center; justify-content: space-between;
  height: 54px;
  position: sticky; top: 0; z-index: 100;
}
.logo {
  display: flex; align-items: center; gap: 10px;
  color: #fff; font-family: var(--mono);
  font-size: 14px; font-weight: 600;
}
.logo-icon {
  width: 28px; height: 28px;
  background: rgba(255,255,255,.15);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
}
.role-tag {
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.22);
  color: #fff;
  font-family: var(--mono);
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: .1em;
}
.hdr-right { display: flex; align-items: center; gap: 8px; }

.conn-pill {
  display: flex; align-items: center; gap: 7px;
  background: rgba(0,0,0,.2);
  border: 1px solid rgba(255,255,255,.1);
  padding: 5px 12px;
  border-radius: 20px;
  font-family: var(--mono);
  font-size: 11px;
  color: rgba(255,255,255,.65);
}
.dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: rgba(255,255,255,.3);
  transition: all .3s;
  flex-shrink: 0;
}
.dot.ok  { background: #4ade80; box-shadow: 0 0 7px #4ade80; animation: dpulse 2.5s infinite; }
.dot.warn{ background: #f59e0b; }
.dot.err { background: #f87171; }
@keyframes dpulse { 0%,100%{opacity:1} 50%{opacity:.5} }

.btn-logout {
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 6px;
  color: rgba(255,255,255,.8);
  cursor: pointer;
  font-family: var(--mono);
  font-size: 11px;
  padding: 5px 10px;
}
.btn-logout:hover { background: rgba(255,0,0,.25); }

/* ── CARDS / PANELS ── */
.card {
  border: 1px solid;
  border-radius: var(--radius);
  padding: 1.25rem 1.4rem;
  margin-bottom: 1rem;
}
.card:last-child { margin-bottom: 0; }

.sec-label {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 8px;
}
.sec-label::after {
  content: ''; flex: 1; height: 1px;
}

/* ── FORM ELEMENTS ── */
.fld { display: flex; flex-direction: column; gap: 5px; }
.fld label {
  font-family: var(--mono);
  font-size: 10px; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase;
}
.fld input, .fld select, .fld textarea {
  border-radius: 6px;
  font-family: var(--sans);
  font-size: 13px;
  padding: 8px 10px;
  outline: none;
  transition: border-color .15s, background .15s;
  width: 100%;
  border: 1px solid;
}
.fld textarea { resize: vertical; min-height: 70px; }
.fld input[readonly] { cursor: default; }

.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin-bottom: 10px; }

/* ── TOAST ── */
.toast {
  position: fixed; bottom: 1.5rem; right: 1.5rem;
  padding: 11px 17px; border-radius: 7px;
  font-family: var(--mono); font-size: 12px; font-weight: 500;
  color: #fff;
  transform: translateY(80px); opacity: 0;
  transition: all .35s cubic-bezier(.34,1.4,.64,1);
  z-index: 9999;
}
.toast.show { transform: translateY(0); opacity: 1; }

/* ── FLASH / ALERT BANNER ── */
.flash-overlay {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 800; opacity: 0;
  transition: opacity .2s;
}
.flash-overlay.on { opacity: 1; }

.alert-banner {
  position: fixed; top: 70px; left: 50%;
  transform: translateX(-50%) translateY(-20px);
  color: #fff;
  font-family: var(--mono); font-size: 15px; font-weight: 600;
  padding: 14px 30px; border-radius: 8px;
  z-index: 900; opacity: 0;
  transition: all .4s cubic-bezier(.34,1.4,.64,1);
  white-space: nowrap;
  box-shadow: 0 8px 24px rgba(0,0,0,.2);
}
.alert-banner.on { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── ITEMS TABLE ── */
.items-hd {
  display: grid;
  grid-template-columns: 2fr 80px 90px 90px 60px 28px;
  gap: 6px; padding: 0 2px 6px;
}
.items-hd span {
  font-family: var(--mono); font-size: 10px;
  font-weight: 600; letter-spacing: .07em; text-transform: uppercase;
}
.item-row {
  display: grid;
  grid-template-columns: 2fr 80px 90px 90px 60px 28px;
  gap: 6px; margin-bottom: 6px; align-items: center;
}
.item-row input, .item-row select {
  border-radius: 6px; font-family: var(--sans);
  font-size: 13px; padding: 7px 9px; outline: none; width: 100%;
  transition: border-color .15s; border: 1px solid;
}
.itot {
  font-family: var(--mono); font-size: 12px;
  font-weight: 600; text-align: right;
}
.btn-rm {
  background: none; border-radius: 5px;
  cursor: pointer; font-size: 15px;
  width: 28px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s; flex-shrink: 0;
  border: 1px solid;
}
.btn-add-row {
  background: none; border-radius: 6px; cursor: pointer;
  font-family: var(--sans); font-size: 13px; padding: 8px;
  width: 100%; text-align: center; transition: all .15s;
  border: 1px dashed;
}

/* ── TOTALS ── */
.tot-box {
  border-radius: 6px; padding: 11px 14px; margin-bottom: 12px;
  border: 1px solid;
}
.tot-row {
  display: flex; justify-content: space-between;
  font-size: 13px; margin-bottom: 4px;
}
.tot-row.grand {
  border-top: 1px solid;
  margin-top: 8px; padding-top: 8px;
  font-weight: 600; font-size: 16px; margin-bottom: 0;
}
.tot-row.grand span:last-child { font-family: var(--mono); }

/* ── SUBMIT BUTTON ── */
.btn-submit {
  width: 100%; border: none; border-radius: 7px; color: #fff;
  cursor: pointer; font-family: var(--sans); font-size: 15px;
  font-weight: 600; padding: 13px;
  transition: all .18s; display: flex; align-items: center;
  justify-content: center; gap: 8px;
}
.btn-submit:active { transform: translateY(0); }
.btn-submit:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* ── MODAL ── */
.modal-bg {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 500; display: flex;
  align-items: center; justify-content: center;
}
.modal {
  background: #fff;
  border-radius: 10px; padding: 1.5rem;
  width: 480px; max-width: calc(100vw - 2rem);
  border: 1px solid;
}
.modal h3 {
  font-family: var(--mono); font-size: 12px;
  letter-spacing: .1em; text-transform: uppercase;
  margin-bottom: 1rem;
}
.modal-note {
  border-radius: 6px; padding: 10px 12px;
  font-family: var(--mono); font-size: 11px;
  line-height: 1.7; margin-top: 10px;
  border: 1px solid;
}
.modal-btns { display: flex; gap: 8px; margin-top: 1rem; }
.btn-sec {
  background: none; border-radius: 6px; cursor: pointer;
  font-family: var(--sans); font-size: 13px; padding: 9px 16px;
  border: 1px solid;
}
.btn-pri {
  border: none; border-radius: 6px; color: #fff;
  cursor: pointer; font-family: var(--sans);
  font-size: 13px; font-weight: 600; padding: 9px 20px;
}

/* ── ORDER CARDS (funcionário) ── */
.order-card {
  border-radius: var(--radius); overflow: hidden;
  animation: popIn .4s cubic-bezier(.34,1.4,.64,1);
  border: 1px solid;
}
@keyframes popIn { from{opacity:0;transform:scale(.92) translateY(-10px)} to{opacity:1;transform:scale(1) translateY(0)} }
.oc-head {
  border-bottom: 1px solid;
  padding: 11px 13px;
  display: flex; align-items: center; justify-content: space-between;
}
.oc-num { font-family: var(--mono); font-size: 14px; font-weight: 600; }
.oc-time { font-family: var(--mono); font-size: 10px; }
.new-badge {
  color: #fff; font-family: var(--mono); font-size: 9px;
  font-weight: 600; padding: 2px 7px; border-radius: 3px;
  animation: blink 1s step-end 6;
}
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0} }
.oc-body { padding: 13px; }
.oc-supplier { font-size: 15px; font-weight: 600; margin-bottom: 2px; }
.oc-meta {
  font-size: 12px; margin-bottom: 10px;
  display: flex; gap: 6px; align-items: center; flex-wrap: wrap;
}
.urg-badge {
  font-family: var(--mono); font-size: 10px;
  padding: 1px 7px; border-radius: 3px;
}
.items-table { width: 100%; border-collapse: collapse; margin-bottom: 10px; }
.items-table th {
  font-family: var(--mono); font-size: 10px; font-weight: 600;
  letter-spacing: .07em; text-transform: uppercase;
  text-align: left; padding: 4px 0; border-bottom: 1px solid;
}
.items-table td { font-size: 12px; padding: 6px 0; border-bottom: 1px solid; vertical-align: top; }
.items-table tr:last-child td { border-bottom: none; }
.td-qty { font-family: var(--mono); font-weight: 600; text-align: right; white-space: nowrap; }
.td-price { font-family: var(--mono); font-size: 11px; text-align: right; white-space: nowrap; }
.obs-box {
  border-radius: 5px; padding: 8px 10px;
  font-size: 12px; margin-bottom: 10px; line-height: 1.5;
  border: 1px solid;
}
.obs-box strong { display: block; font-family: var(--mono); font-size: 10px; margin-bottom: 2px; }
.oc-foot {
  border-top: 1px solid;
  padding: 10px 13px; display: flex;
  align-items: center; justify-content: space-between;
}
.oc-total { font-family: var(--mono); font-size: 15px; font-weight: 600; }
.foot-btns { display: flex; gap: 6px; }
.btn-reprint {
  background: none; border-radius: 6px; cursor: pointer;
  font-family: var(--mono); font-size: 11px; padding: 6px 10px;
  transition: all .15s; border: 1px solid;
}
.btn-done {
  border-radius: 6px; cursor: pointer; font-family: var(--mono);
  font-size: 11px; font-weight: 600; padding: 6px 12px;
  transition: all .15s; border: 1px solid;
}
.empty-state { grid-column: 1/-1; text-align: center; padding: 5rem 2rem; }
.empty-icon { font-size: 3rem; margin-bottom: 1rem; }
.empty-title { font-size: 1rem; font-weight: 600; margin-bottom: 6px; }
.empty-sub { font-family: var(--mono); font-size: 12px; line-height: 2; }

/* ── TOPBAR ── */
.topbar {
  max-width: 1080px; margin: .8rem auto 0; padding: 0 1.4rem;
  display: flex; align-items: center; justify-content: space-between;
}
.page-status {
  font-family: var(--mono); font-size: 11px; font-weight: 600;
  letter-spacing: .1em; text-transform: uppercase;
}
.btn-clr {
  background: none; border-radius: 6px; cursor: pointer;
  font-family: var(--mono); font-size: 11px; padding: 6px 12px;
  border: 1px solid;
}

/* ── HISTORY PANEL ── */
.hist-panel { display: flex; flex-direction: column; height: calc(100vh - 86px); }
.hist-scroll { flex: 1; overflow-y: auto; margin-top: .5rem; }
.hist-scroll::-webkit-scrollbar { width: 4px; }
.hist-scroll::-webkit-scrollbar-thumb { border-radius: 2px; }
.hist-empty { text-align: center; padding: 3rem 1rem; font-family: var(--mono); font-size: 12px; line-height: 2; }
.hc { border: 1px solid; border-radius: 7px; padding: 10px 12px; margin-bottom: 8px; animation: fslide .3s ease; }
@keyframes fslide { from{opacity:0;transform:translateY(-6px)} to{opacity:1;transform:translateY(0)} }
.hc-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 3px; }
.hc-num { font-family: var(--mono); font-size: 12px; font-weight: 600; }
.hc-time { font-family: var(--mono); font-size: 10px; }
.hc-sup { font-weight: 600; font-size: 13px; margin-bottom: 3px; }
.hc-meta { font-size: 12px; }
.hc-total { font-family: var(--mono); font-size: 13px; font-weight: 600; text-align: right; margin-top: 4px; }
.urg-tag { display: inline-block; font-family: var(--mono); font-size: 10px; padding: 1px 7px; border-radius: 3px; margin-left: 6px; }

/* ── COUNT PILL ── */
.count-pill {
  font-family: var(--mono); font-size: 12px; font-weight: 600;
  padding: 4px 12px; border-radius: 20px; display: none;
}

/* ── LAYOUT ── */
.layout {
  display: grid; grid-template-columns: 1fr 340px;
  gap: 1.2rem; max-width: 1080px; margin: 0 auto; padding: 1.4rem;
}
.grid {
  max-width: 1080px; margin: 1rem auto; padding: 0 1.4rem 2rem;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1rem;
}

@media (max-width: 760px) {
  .layout { grid-template-columns: 1fr; }
  .hist-panel { height: auto; }
  .row2, .row3 { grid-template-columns: 1fr; }
  .items-hd, .item-row { grid-template-columns: 1fr 70px 80px 80px 50px 28px; }
}
