:root {
  color-scheme: light;
  font: 16px/1.45 system-ui, sans-serif;
  color: #182725;
  background: #eef3f1;
  --ink: #17372f;
  --line: #d7e3dd;
  --green: #08694e;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button, input, select { font: inherit; min-height: 46px; border-radius: .6rem; }
button, .action {
  background: var(--green); color: #fff; border: 1px solid transparent;
  padding: .65rem 1rem; cursor: pointer; font-weight: 650;
}
button:disabled { opacity: .52; cursor: default; }
.secondary { background: #eff6f2; border-color: var(--line); color: var(--ink); }
:focus-visible { outline: 3px solid #007c9e; outline-offset: 2px; }
.shell { display: grid; grid-template-columns: 14rem minmax(0, 1fr); min-height: 100vh; }
.rail { background: #142f29; color: #fff; padding: 1.4rem 1rem; }
.brand {
  text-decoration: none; color: white; display: flex; gap: .6rem; align-items: center;
  font-size: 1.4rem; font-weight: 800; margin-bottom: 2.25rem;
}
.brand span { display: grid; place-items: center; background: #b6f59d; color: var(--ink); width: 2.1rem; height: 2.1rem; border-radius: .6rem; }
nav { display: grid; gap: .4rem; margin-bottom: 1rem; }
nav button { background: transparent; text-align: left; }
nav button[aria-current="page"] { background: #b6f59d; color: var(--ink); }
nav details { padding: 0 .3rem; }
nav summary { padding: .65rem .7rem; min-height: 46px; }
nav details button { display: block; width: 100%; padding-left: 1.4rem; }
.app-meta { display: grid; gap: .15rem; margin-top: .6rem; color: #c3d7cf; font-size: .8rem; }
main { width: min(100%, 90rem); padding: clamp(1rem, 3vw, 2.75rem); }
.bar, .section-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 1.1rem; font-size: clamp(1.65rem, 4vw, 2.45rem); letter-spacing: -.035em; }
h2 { font-size: 1.18rem; margin-bottom: .85rem; }
small { font-size: .73rem; font-weight: 750; letter-spacing: .12em; color: #355e51; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 1rem; padding: clamp(1rem, 2vw, 1.5rem); }
.login { max-width: 29rem; }
.login p, .muted { color: #4c625b; }
label { display: grid; gap: .25rem; font-weight: 600; min-width: 0; }
input, select { width: 100%; min-width: 0; padding: .5rem .65rem; color: inherit; border: 1px solid #b7c9c1; background: #fff; }
form, .context { display: grid; gap: .75rem; }
.context { grid-template-columns: 1fr 1fr; margin-bottom: 1rem; }
.pos-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(18.5rem, 1fr); gap: 1rem; align-items: start; }
.inline { grid-template-columns: minmax(0, 1fr) auto; margin-bottom: .8rem; }
.products { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 11rem), 1fr)); gap: .65rem; }
.product { text-align: left; background: #f4f8f6; color: var(--ink); border-color: var(--line); display: grid; gap: .25rem; max-width: 18rem; }
.product span { font-weight: 500; font-size: .85rem; overflow-wrap: anywhere; }
.product-thumb {
  width: 100%;
  height: 92px;
  object-fit: contain;
  object-position: center;
  border-radius: .5rem;
  border: 1px solid var(--line);
  background: #fff;
  cursor: zoom-in;
}
@media (max-width: 640px) {
  .product { max-width: none; }
  .product-thumb { height: 110px; }
}
.price-tiers { width: 100%; border-collapse: collapse; font-size: .7rem; margin: .15rem 0; }
.price-tiers th, .price-tiers td {
  padding: .1rem .15rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}
.price-tiers th { font-weight: 700; color: #4c625b; }
.price-tiers .num { text-align: right; font-variant-numeric: tabular-nums; }
.price-tiers tbody tr { cursor: pointer; }
.price-tiers tbody tr:hover { background: #e9f1ed; }
.line, .sale { padding: .8rem 0; border-bottom: 1px solid var(--line); }
.line-fields, .sale-actions { display: flex; flex-wrap: wrap; align-items: end; gap: .55rem; margin-top: .5rem; }
.line-fields label { flex: 1 1 5rem; }
.totals div { display: flex; justify-content: space-between; padding: .28rem 0; }
dd { margin: 0; font-variant-numeric: tabular-nums; }
.grand { border-top: 1px solid var(--line); margin-top: .45rem; font-size: 1.35rem; font-weight: 780; }
.notice { background: #dff0e7; border: 1px solid #aed6c0; padding: .75rem 1rem; border-radius: .6rem; overflow-wrap: anywhere; }
.notice.error { background: #fff1ee; border-color: #ebaa9c; color: #782b20; }
.action { display: inline-block; text-decoration: none; }
dialog { max-width: min(32rem, 92vw); padding: 1.5rem; border-radius: 1rem; border: 1px solid var(--line); }
dialog::backdrop { background: #122e28a8; }
dialog form { justify-items: end; margin-bottom: .65rem; }
dialog form:not([method="dialog"]) { justify-items: stretch; }
textarea { font: inherit; width: 100%; padding: .5rem .65rem; color: inherit; border: 1px solid #b7c9c1; border-radius: .6rem; }
.toolbar { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.form-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; }
.check { display: flex; align-items: center; gap: .5rem; }
.check input { width: 1.35rem; min-height: 1.35rem; accent-color: var(--green); }
#receiving, #suppliers, #settings { max-width: 70rem; }
#settings .toolbar, #settings form, #receiving details, #receipt-review, #receipt-editor { margin: .9rem 0; }
#settings select, #settings input, #receiving select, #receiving input[type="file"] { max-width: 32rem; }
summary { cursor: pointer; font-weight: 650; padding: .5rem 0; }
pre { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 15rem; overflow: auto; padding: .75rem; background: #eff6f2; }
#assistant-dialog { width: min(58rem, 94vw); max-width: 94vw; }
#assistant-results { overflow-x: auto; }
.table-scroll { overflow-x: auto; margin-bottom: .75rem; }
#report-kind-label { max-width: 25rem; margin-bottom: .75rem; }
#report-filters { margin-bottom: .6rem; }
#report-filters select { min-width: 11rem; }
#report-filters label { font-weight: 600; }
#document-dialog { width: min(60rem, 94vw); max-width: 94vw; }
#catalog-dialog { width: min(43rem, 94vw); max-width: 94vw; }
#report-add { margin-bottom: .8rem; }
.row-actions { display: flex; flex-wrap: wrap; gap: .4rem; }
.catalog-parent { grid-column: 1 / -1; }
.catalog-parent .inline { display: grid; margin-bottom: .5rem; }
.postal-lookup { grid-column: 1 / -1; display: grid; gap: .35rem; margin: -.1rem 0 .3rem; }
.postal-lookup p { margin: 0; font-size: .85rem; }
.postal-lookup select { max-width: 32rem; }
.geo-picker {
  grid-column: 1 / -1; background: #f4f8f6; border: 1px solid var(--line);
  border-radius: .6rem; padding: .5rem .8rem; margin: .2rem 0 .4rem;
}
.geo-picker summary { padding: .35rem 0; }
.geo-picker .form-columns { margin-top: .35rem; }
.geo-picker p { margin: .35rem 0 0; font-size: .85rem; }
.rows-editor { display: grid; gap: .4rem; margin: .4rem 0; }
.rows-editor .row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: end; }
.rows-editor .row label { flex: 1 1 8rem; }
.media-preview {
  max-width: 100%;
  max-height: 190px;
  border-radius: .7rem;
  border: 1px solid var(--line);
  background: #fff;
}
#concepts-list .sale { display: grid; gap: .4rem; }
#concepts-list input { max-width: 22rem; }
#report td, #document-dialog td { overflow-wrap: anywhere; }
table { border-collapse: collapse; width: 100%; font-size: .9rem; }
td, th { padding: .5rem; text-align: left; border-bottom: 1px solid var(--line); }
@media (min-width: 1031px) {
  .rail { position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; }
  nav { min-height: 0; overflow-y: auto; align-content: start; }
  #session-footer { margin-top: auto; }
}
@media (max-width: 1030px) {
  .shell { grid-template-columns: 1fr; }
  .rail { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
  .brand, nav { margin: 0; }
  nav { display: flex; flex-wrap: wrap; }
  nav details[open] { flex-basis: 100%; }
  nav details button { display: inline-block; width: auto; padding-left: 1rem; }
  #session-footer { margin-left: auto; }
}
@media (max-width: 660px) {
  .pos-grid, .context { grid-template-columns: 1fr; }
  .bar { align-items: start; }
}
@media print {
  :root, body { background: white; color: black; }
  .shell { display: block; min-height: auto; }
  main { max-width: none; width: auto; padding: 0; }
  .rail, .toolbar, button, #message, #report-kind-label, #report-search, #suppliers-search, .check,
  .report-actions, .row-actions { display: none !important; }
  #workspace > .context { border: none; padding: 0; }
  #workspace > .context select { appearance: none; border: 0; padding: 0; }
  .panel { border: 0; padding: 0; box-shadow: none; }
  .table-scroll { overflow: visible; }
  table { font-size: 9pt; }
  tr { break-inside: avoid; }
}

/* ---------- Menú flotante, tarjetas y acabado visual (0.2.5) ---------- */
.shell { grid-template-columns: 15.5rem minmax(0, 1fr); gap: clamp(.6rem, 1.4vw, 1.1rem); }

.rail {
  background: linear-gradient(168deg, #173c32 0%, #0c231c 100%);
  border-radius: 1.5rem;
  margin: clamp(.6rem, 1.4vw, 1.2rem) 0 clamp(.6rem, 1.4vw, 1.2rem) clamp(.6rem, 1.4vw, 1.2rem);
  padding: 1.5rem 1rem;
  border: 1px solid rgba(182, 245, 157, .14);
  box-shadow: 0 32px 64px -30px rgba(5, 26, 20, .7), 0 12px 28px -22px rgba(5, 26, 20, .6);
}

.brand { margin-bottom: 1.7rem; letter-spacing: -.02em; }
.brand span {
  background: linear-gradient(145deg, #caffb2, #8fe07a);
  box-shadow: 0 10px 24px -12px rgba(182, 245, 157, .85);
}
.brand span.has-logo {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  box-shadow: 0 6px 16px -8px rgba(0, 0, 0, .55);
  border: 1px solid rgba(255, 255, 255, .35);
}

nav { gap: .28rem; }
nav button {
  position: relative;
  border-radius: .9rem;
  padding: .62rem .8rem .62rem 2.45rem;
  color: #dcefe6;
  transition: background .18s ease, transform .18s ease, box-shadow .18s ease, color .18s ease;
}
nav button::before {
  position: absolute;
  left: .82rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1rem;
  line-height: 1;
  opacity: .9;
}
nav button:hover { background: rgba(255, 255, 255, .08); transform: translateX(3px); }
nav button[aria-current="page"] {
  background: linear-gradient(95deg, #b6f59d, #8fe07a);
  color: var(--ink);
  box-shadow: 0 14px 26px -14px rgba(182, 245, 157, .95);
}
nav details summary { border-radius: .9rem; transition: background .18s ease; }
nav details summary:hover { background: rgba(255, 255, 255, .08); }
nav details button { padding-left: 2.45rem; }

nav button[data-view="pos"]::before { content: "🛒"; }
nav button[data-view="sales"]::before { content: "🧾"; }
nav button[data-view="customers"]::before { content: "👥"; }
nav button[data-view="suppliers"]::before { content: "🚚"; }
nav button[data-view="products"]::before { content: "👕"; }
nav button[data-view="states"]::before { content: "🗺️"; }
nav button[data-view="municipalities"]::before { content: "🏛️"; }
nav button[data-view="cities"]::before { content: "🏙️"; }
nav button[data-view="neighborhoods"]::before { content: "📍"; }
nav button[data-view="streets"]::before { content: "🛣️"; }
nav button[data-view="carriers"]::before { content: "📦"; }
nav button[data-view="warehouse-report"]::before { content: "🏬"; }
nav button[data-view="receiving"]::before { content: "📥"; }
nav button[data-view="receivables"]::before { content: "💰"; }
nav button[data-view="payables"]::before { content: "💳"; }
nav button[data-view="users"]::before { content: "👤"; }
nav button[data-view="audit"]::before { content: "📜"; }
nav button[data-view="branches"]::before { content: "🏢"; }
nav button[data-view="companies"]::before { content: "🏭"; }
nav button[data-view="settings"]::before { content: "⚙️"; }

.panel {
  box-shadow: 0 24px 48px -42px rgba(8, 38, 30, .6), 0 1px 0 rgba(8, 38, 30, .04);
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr));
  gap: .85rem;
}
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: .95rem 1.05rem;
  display: grid;
  gap: .6rem;
  box-shadow: 0 18px 36px -30px rgba(8, 38, 30, .55);
  transition: transform .16s ease, box-shadow .16s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 24px 44px -30px rgba(8, 38, 30, .6); }
.card h3 { margin: 0; font-size: 1.02rem; letter-spacing: -.01em; }
.card dl { margin: 0; display: grid; gap: .32rem; }
.card dl div { display: flex; gap: .8rem; justify-content: space-between; font-size: .86rem; }
.card dt { color: #4c625b; }
.card dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
.card .row-actions { margin-top: .15rem; }

@media (max-width: 1030px) {
  .shell { grid-template-columns: 1fr; }
  .rail { margin: .6rem .6rem 0; padding: 1rem; }
}

/* ---------- Marca destacada, almacén y documentos (0.3.0) ---------- */
.brand { font-size: .72rem; letter-spacing: .02em; gap: .55rem; }
nav button {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.brand span {
  width: 5.5rem;
  height: 5.5rem;
  font-size: 2rem;
  border-radius: 1rem;
}
.print-header { display: none; }
#print-logo { max-height: 70px; max-width: 150px; object-fit: contain; }
#stock-dialog { width: min(34rem, 94vw); }
#stock-form { gap: .6rem; }
#stock-info { margin: 0; }

@media print {
  .print-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1.5rem;
    border-bottom: 2px solid #000;
    padding-bottom: .6rem;
    margin-bottom: 1rem;
    font-size: 9pt;
  }
  .print-header img { max-height: 70px; max-width: 150px; object-fit: contain; }
  .print-company, .print-meta { display: grid; gap: .1rem; }
  .print-meta { text-align: right; }
  #print-title { font-size: 11pt; }
  .audit-card details { display: none; }
}

/* ---------- Bitácora legible (0.3.5) ---------- */
.audit-list { display: grid; gap: .6rem; }
.audit-card {
  border: 1px solid var(--line);
  border-radius: .8rem;
  padding: .7rem .9rem;
  background: #fff;
  box-shadow: 0 12px 26px -24px rgba(8, 38, 30, .55);
  display: grid;
  gap: .3rem;
}
.audit-card .badge {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--green);
  background: #e7f4ec;
  border-radius: 999px;
  padding: .18rem .55rem;
}
.audit-changes { margin: .15rem 0 0; padding-left: 1.1rem; display: grid; gap: .12rem; }
.audit-changes li { font-size: .88rem; }
.audit-field { color: #4c625b; font-weight: 600; }
.audit-card details summary { font-size: .82rem; color: #4c625b; cursor: pointer; }
.audit-card pre { margin: .3rem 0 0; font-size: .75rem; max-height: 12rem; }

/* ---------- Miniatura y vista de imagen del producto (0.3.8) ---------- */
.row-thumb {
  width: 38px;
  height: 38px;
  object-fit: cover;
  border-radius: .4rem;
  border: 1px solid var(--line);
  cursor: zoom-in;
  display: block;
  background: #f7faf8;
}
.row-thumb.empty {
  display: grid;
  place-items: center;
  padding: 0;
  border-style: dashed;
  background: #fbfdfc;
  color: #6b837b;
  font-size: 1rem;
  cursor: pointer;
}
#image-dialog { width: min(46rem, 94vw); }
#image-preview { max-width: 100%; max-height: 68vh; border-radius: .6rem; display: block; }
#image-dialog .section-head { margin-bottom: .3rem; }

/* ---------- Resultados de búsqueda en Recepción (0.5.3) ---------- */
.item-results { display: grid; gap: .35rem; margin: .3rem 0 .7rem; }
.item-result {
  display: flex;
  gap: .6rem;
  align-items: center;
  text-align: left;
  background: #f4f8f6;
  color: var(--ink);
  border: 1px solid var(--line);
  padding: .35rem .5rem;
  font-weight: 500;
}
.item-result:hover { border-color: var(--green); }
.item-thumb {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: .4rem;
  background: #e9f1ed;
  font-size: .95rem;
}
.item-thumb-img { width: 100%; height: 100%; object-fit: cover; }
.item-text { display: grid; gap: .1rem; min-width: 0; }
.item-text strong { overflow-wrap: anywhere; }
.line-thumb {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: .4rem;
  border: 1px solid var(--line);
  background: #f7faf8;
}

/* ---------- Órdenes de compra (0.6.0) ---------- */
#orders-dialog { width: min(48rem, 94vw); }
#order-dialog { width: min(60rem, 96vw); }
#orders-list { display: grid; gap: .4rem; }
.order-row {
  display: grid;
  gap: .15rem;
  text-align: left;
  background: #f4f8f6;
  color: var(--ink);
  border: 1px solid var(--line);
  padding: .5rem .7rem;
  font-weight: 500;
  cursor: pointer;
}
.order-row:hover { border-color: var(--green); }
.order-info { display: grid; gap: .25rem; margin: .5rem 0 .7rem; }
.order-info div { display: flex; gap: .8rem; justify-content: space-between; font-size: .9rem; }
.order-info dt { color: #4c625b; }
.order-info dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
.grand-total { font-weight: 800; font-size: 1.15rem; margin: .5rem 0 0; }
#movements-dialog { width: min(64rem, 96vw); }
#movement-dialog { width: min(46rem, 94vw); }
#movements-list table { min-width: 40rem; }
.movement-row { cursor: pointer; }
.movement-row:hover { background: #f4f8f6; }

/* ---------- Controles compactos de consulta (0.7.1) ---------- */
.report-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem;
  margin-bottom: .7rem;
}
.report-controls .toolbar { margin: 0; gap: .5rem; }
.report-controls .check { margin: 0; font-weight: 600; white-space: nowrap; }
.report-controls #report-kind-label {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  margin: 0;
  max-width: none;
  white-space: nowrap;
}
.report-controls #report-kind {
  width: auto;
  min-width: 0;
  max-width: 14rem;
}
.report-controls #report-search {
  display: flex;
  gap: .5rem;
  margin: 0;
  flex: 1 1 18rem;
  min-width: 12rem;
}
.report-controls #report-search input { flex: 1 1 auto; min-width: 7rem; }
.report-controls #report-search button { flex: 0 0 auto; }
.report-controls #report-inactive-label { margin: 0; }

/* ---------- Usuarios de la empresa (0.8.0) ---------- */
.branches-box {
  grid-column: 1 / -1;
  display: grid;
  gap: .3rem;
  border: 1px solid var(--line);
  border-radius: .6rem;
  padding: .5rem .8rem;
}
.branches-box legend { font-weight: 700; padding: 0 .3rem; }
.branches-box .check { justify-content: flex-start; }
#user-picker-dialog { width: min(30rem, 94vw); }
#user-view-dialog { width: min(42rem, 94vw); }
#order-print-area { display: none; }

@media print {
  body.printing-order .shell, body.printing-order #print-header { display: none !important; }
  body.printing-order dialog { display: none !important; }
  body.printing-order #order-print-area { display: block; }
  body.printing-order #order-print-area table { width: 100%; }
  body.printing-order #order-print-area h2 { margin-top: 0; }
}

/* ---------- Tableta y PC (0.5.2) ---------- */
dialog { max-height: 92dvh; overflow: auto; }
#report table { min-width: 44rem; }

@media (max-width: 1030px) {
  .rail {
    position: sticky;
    top: 0;
    z-index: 20;
    margin: 0;
    padding: .6rem .8rem;
    box-shadow: 0 10px 24px -18px rgba(0, 0, 0, .55);
  }
  .brand { font-size: .78rem; }
  .brand span {
    width: 3.4rem;
    height: 3.4rem;
    font-size: 1.35rem;
    border-radius: .8rem;
  }
  nav button { min-height: 44px; padding-block: .45rem; }
  main { padding: clamp(.8rem, 2vw, 1.6rem); }
  .context { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 900px) {
  .form-columns { grid-template-columns: 1fr; }
  .pos-grid, .context { grid-template-columns: 1fr; }
  .cards { grid-template-columns: 1fr !important; }
  .inline { grid-template-columns: 1fr; }
  .inline button { width: 100%; }
  dialog { max-width: 96vw; }
  #report table { min-width: 38rem; }
  .section-head { flex-wrap: wrap; }
}

@media (max-width: 640px) {
  .rail { padding: .5rem .6rem; }
  .brand { flex-basis: 100%; margin-bottom: .3rem; }
  nav { flex-basis: 100%; display: grid; grid-template-columns: 1fr 1fr; }
  nav button { font-size: .9rem; padding-inline: .55rem; }
  nav details[open] { grid-column: 1 / -1; }
  #session-footer { margin-left: 0; flex-basis: 100%; }
  h1 { font-size: 1.9rem; }
  table { font-size: .84rem; }
  td, th { padding: .4rem; }
  #report table { min-width: 32rem; }
  .row-thumb { width: 34px; height: 34px; }
}

@media (pointer: coarse) {
  button, input, select, summary { min-height: 48px; }
  .check input { min-height: 1.6rem; }
  .row-thumb { width: 42px; height: 42px; }
}



.cart-thumb {
  width: 46px;
  height: 46px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: .4rem;
  background: #fff;
  float: left;
  margin: .1rem .55rem .2rem 0;
}
#cash-change { font-weight: 700; }

.product .add-hint {
  justify-self: start;
  font-size: .74rem;
  font-weight: 800;
  color: var(--green);
  background: #e2f1e9;
  border-radius: 999px;
  padding: .12rem .5rem;
}

/* ---------- Ticket de venta (0.10.1) ---------- */
.ticket {
  font-family: "Courier New", monospace;
  font-size: .82rem;
  max-width: 22rem;
  margin: 0 auto;
}
.ticket-head { text-align: center; display: grid; gap: .15rem; margin-bottom: .4rem; }
.ticket-logo { max-height: 64px; margin: 0 auto; }
.ticket-head strong { font-size: 1rem; letter-spacing: .04em; }
.ticket-row { display: flex; justify-content: space-between; gap: .6rem; }
.ticket-sep { border-top: 1px dashed #8aa39a; margin: .35rem 0; }
.ticket-table { width: 100%; font-size: .76rem; }
.ticket-table th, .ticket-table td { padding: .12rem .1rem; border-bottom: none; }
.ticket-table td:nth-child(3), .ticket-table td:nth-child(4),
.ticket-table th:nth-child(3), .ticket-table th:nth-child(4) { text-align: right; }
.ticket-thanks { text-align: center; font-weight: 700; margin-top: .5rem; }
@media print {
  body.printing-order #order-print-area { width: 80mm; margin: 0 auto; padding: 0; }
  body.printing-order #order-print-area h2 { display: none; }
}

.ticket-qr { width: 118px; height: 118px; margin: 0 auto .25rem; display: block; }

.ticket-title { margin-top: .25rem; font-weight: 800; letter-spacing: .12em; }
.ticket-sign {
  margin-top: 1.5rem;
  border-top: 1px solid #000;
  padding-top: .2rem;
  text-align: center;
  font-size: .72rem;
}
@media print {
  body.printing-order #order-print-area .ticket { max-width: 100%; font-size: .8rem; }
  body.printing-order #order-print-area .ticket-sign { margin-top: 1.8rem; }
}

.cut-mark { color: #b3261e; font-weight: 700; }
#ticket-dialog { width: min(24rem, 96vw); }
#ticket-dialog .ticket { font-size: .76rem; }
#ticket-dialog .ticket-table { table-layout: fixed; }
#ticket-dialog .ticket-table td, #ticket-dialog .ticket-table th { padding: .1rem .15rem; }
#ticket-dialog .ticket-logo { max-height: 42px; }
#ticket-dialog .ticket-qr { width: 92px; height: 92px; }
#ticket-dialog .section-head { margin-bottom: .2rem; }

.sales-table { width: 100%; font-size: .84rem; }
.sales-table th, .sales-table td { padding: .45rem .4rem; border-bottom: 1px solid var(--line); text-align: left; }
.sales-table th { color: #4c625b; font-size: .76rem; }
.sales-table .num { text-align: right; white-space: nowrap; }
.sales-table .report-actions { white-space: nowrap; }
.sales-table .cut-mark { color: #b3261e; font-weight: 700; white-space: nowrap; }

#dashboard-dialog { width: min(52rem, 96vw); }
.dash-totals { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: .6rem; margin: .8rem 0; }
.dash-total { background: #f2f6f4; border: 1px solid var(--line); border-radius: .8rem; padding: .6rem .7rem; display: grid; gap: .2rem; }
.dash-total strong { font-size: 1.15rem; }
.dash-card { border: 1px solid var(--line); border-radius: .9rem; padding: .7rem; margin-top: .8rem; background: #fff; }
.dash-bar-row { display: grid; grid-template-columns: minmax(6rem, 10rem) 1fr; gap: .6rem; align-items: center; margin-top: .45rem; font-size: .82rem; }
.dash-track { position: relative; background: #eef3f0; border-radius: 999px; height: 1.55rem; overflow: hidden; }
.dash-bar { position: absolute; inset: 0 auto 0 0; background: #2f7a5d; opacity: .35; }
.dash-value { position: relative; padding: .2rem .55rem; font-weight: 700; display: block; }

button:focus-visible {
  outline: 3px solid #8fc9ae;
  outline-offset: 2px;
}
#dashboard-open { font-weight: 700; }

#dashboard-dialog { width: min(64rem, 96vw); }
#dashboard-tabs { margin-bottom: .4rem; }

#dashboard-dialog { width: min(64rem, 96vw); max-width: min(64rem, 96vw); }
.dash-chart-scroll { overflow-x: auto; padding-bottom: .3rem; }
.dash-chart-svg { width: 100%; min-width: 34rem; height: auto; display: block; }
.dash-table { width: 100%; font-size: .8rem; margin-top: .5rem; }
.dash-table th, .dash-table td { padding: .35rem .3rem; border-bottom: 1px solid var(--line); text-align: left; }
.dash-table .num { text-align: right; white-space: nowrap; }
.dash-dot { display: inline-block; width: .65rem; height: .65rem; border-radius: .2rem; margin-right: .4rem; }

#cancel-sale-dialog { width: min(30rem, 94vw); }
#cancel-sale-body { margin: .8rem 0; }
#cancel-sale-body .ticket-row { padding: .25rem 0; }
button.danger {
  background: #b3261e;
  border-color: #b3261e;
  color: #fff;
  font-weight: 700;
}
button.danger:hover { background: #94201a; }

.permission-row { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; padding: .35rem 0; border-bottom: 1px dashed var(--line); }
.permission-process { min-width: 9rem; }
.permission-row .check { font-size: .82rem; }
.branches-box .permission-row input[disabled] { opacity: .75; }

#branch-location-dialog { width: min(36rem, 94vw); }
#branch-location-url { width: 100%; margin: .5rem 0 .8rem; padding: .55rem .7rem;
  border: 1px solid var(--line); border-radius: .6rem; font-size: .85rem; }
