:root {
  color-scheme: light;
  font-family: system-ui, sans-serif;
  color: #182635;
  background: #f3f6fa;
  --nav: #171d16;
  --accent: #3d6213;
  --border: #dce4ec;
  --muted: #55677a;
}
* { box-sizing: border-box; }
body { margin: 0; }
h1, h2, h3, p { margin: 0 0 .7rem; }
h1 { font-size: clamp(1.8rem, 5vw, 2.6rem); letter-spacing: -.045em; }
h2 { font-size: 1.18rem; letter-spacing: -.02em; }
h3 { font-size: 1rem; }
a { color: var(--accent); }
small { color: var(--muted); }
button, .button {
  border: 1px solid transparent; border-radius: .6rem; background: var(--accent); color: white;
  padding: .65rem .95rem; font: inherit; font-weight: 700; text-decoration: none; cursor: pointer;
}
button:hover, .button:hover { filter: brightness(.92); }
button:disabled { opacity: .55; cursor: wait; }
button.quiet { background: #f0f5e9; color: #3a571b; border-color: #dfe9d4; font-size: .86rem; }
button.danger { color: #9d2525; background: #fff1f1; border-color: #fae0e0; }
:focus-visible { outline: 3px solid #5b8225; outline-offset: 2px; }
.layout { display: grid; grid-template-columns: 228px minmax(0, 1fr); min-height: 100vh; }
aside { background: var(--nav); color: #fff; padding: 1.35rem 1rem; display: flex; flex-direction: column; gap: 1.4rem; }
.brand { display: grid; justify-items: start; gap: .55rem; line-height: 1.25; }
.brand-logo { background: white; border-radius: .65rem; padding: .3rem .6rem; width: min(100%, 196px); }
.brand-logo img { display: block; width: 100%; height: auto; }
.brand small { font-size: .65rem; letter-spacing: .14em; font-weight: 800; }
aside small { color: #ccd3c9; }
nav { display: grid; gap: .3rem; }
nav a { text-decoration: none; color: #e3eaf1; padding: .7rem .75rem; border-radius: .5rem; font-size: .93rem; }
nav a:hover, nav a[aria-current] { background: #35482b; color: #edffd9; }
.account { margin-top: auto; padding: .8rem .4rem 0; border-top: 1px solid #394738; overflow-wrap: anywhere; }
.account small { display: block; margin: .2rem 0 .7rem; }
#content { width: 100%; max-width: 1460px; padding: clamp(1rem, 3.4vw, 3rem); margin: 0 auto; }
.page-header, .section-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.page-header p:last-child, .muted { color: var(--muted); }
.eyebrow { color: var(--accent); font-size: .68rem; letter-spacing: .14em; font-weight: 800; }
.panel, .metric { background: white; border: 1px solid var(--border); border-radius: .9rem; padding: clamp(.85rem, 2vw, 1.4rem); min-width: 0; }
.panel { margin-bottom: 1rem; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .85rem; margin-bottom: 1rem; }
.metric p, .metric small { color: var(--muted); }
.metric p { font-size: .9rem; }
.metric strong { display: block; font-size: clamp(1rem, 1.7vw, 1.5rem); margin: .35rem 0; overflow-wrap: anywhere; }
.split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1rem; align-items: start; }
.form-list { grid-template-columns: minmax(220px, 1fr) minmax(0, 2fr); }
.chart-row { display: grid; grid-template-columns: 4.2rem 1fr auto; align-items: center; gap: .65rem; margin: .9rem 0; font-size: .85rem; }
meter { width: 100%; height: 1rem; }
meter::-webkit-meter-optimum-value { background: var(--accent); }
meter::-moz-meter-bar { background: var(--accent); }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; text-align: left; }
th { font-size: .76rem; color: var(--muted); }
th, td { border-bottom: 1px solid var(--border); padding: .65rem .55rem; vertical-align: top; overflow-wrap: anywhere; }
td small { display: block; margin-top: .2rem; }
.row-actions { display: flex; gap: .35rem; flex-wrap: wrap; }
label { display: block; font-size: .85rem; font-weight: 680; margin: .65rem 0; }
input, select, textarea { width: 100%; margin-top: .3rem; border: 1px solid #c4cfdb; border-radius: .55rem; padding: .55rem .65rem; color: inherit; background: white; font: inherit; }
textarea { min-height: 4rem; resize: vertical; }
input:disabled, select:disabled { background: #edf1f5; }
input[type="checkbox"] { width: auto; margin-right: .25rem; }
.actions { margin: .85rem 0 .25rem; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 .75rem; }
.line-input { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) auto; align-items: end; gap: .65rem; }
.sale-line { grid-template-columns: minmax(0, 2fr) minmax(0, .55fr) minmax(0, 1fr) auto; }
.line-input button { margin-bottom: .65rem; }
.sale-total { margin: 1rem 0; font-size: 1.13rem; }
.sale-total b { margin-left: .4rem; }
.catalog { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: .8rem; margin-top: 1rem; }
.piece { border: 1px solid var(--border); border-radius: .65rem; overflow: hidden; }
.piece img, .placeholder { width: 100%; aspect-ratio: 4 / 3; object-fit: contain; background: #edf3f6; display: block; }
.placeholder { display: grid; place-items: center; font-size: 2rem; color: #587c87; font-weight: 850; }
.piece-info { padding: .85rem; overflow-wrap: anywhere; }
.piece-price { margin: .65rem 0; }
.piece-price small { display: block; margin-top: .2rem; }
.editor-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(230px, 1fr); gap: 1rem; align-items: start; }
.editor-grid h3 { margin-top: .7rem; }
.estimate { background: #eef5e6; border-radius: .65rem; padding: 1rem; }
#estimate-lines div, #profit div { display: flex; justify-content: space-between; gap: .6rem; font-size: .86rem; padding: .3rem 0; }
#estimate-lines .emphasis { border-top: 1px solid #c6d5ba; margin-top: .25rem; padding-top: .5rem; }
.tag { display: inline-block; border-radius: 3rem; padding: .25rem .55rem; white-space: nowrap; font-weight: 700; font-size: .75rem; }
.pending { background: #fff2ce; color: #6e4b08; }
.paid { background: #daf4e8; color: #185e44; }
.cancelled { background: #f4e6e6; color: #922b2b; }
.message:empty { display: none; }
.message:not(:empty), .credential { background: #fff0ee; color: #7c2526; border: 1px solid #f4cccc; border-radius: .55rem; padding: .65rem; }
.credential { background: #daf4e8; color: #185e44; border-color: #c6d5ba; overflow-wrap: anywhere; }
.empty, .loading { padding: .8rem; color: var(--muted); background: #f3f6fa; border-radius: .55rem; }
.login { min-height: 100vh; display: grid; place-items: center; padding: 1.2rem; background: radial-gradient(ellipse at top right, #405b28, #171d16 65%); }
.login-card { max-width: 430px; width: 100%; padding: clamp(1.4rem, 5vw, 2.5rem); background: white; border-radius: 1rem; }
.login-card .brand { margin-bottom: 1.5rem; }
.login-card .brand-logo { width: min(100%, 220px); padding: 0; }
.login-card h1 { font-size: 2rem; }
.login-card button { width: 100%; margin-top: .4rem; }
.narrow { max-width: 500px; }
@media (max-width: 1100px) { .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); } .editor-grid { grid-template-columns: 1fr; } }
@media (max-width: 840px) { aside .brand { display: flex; align-items: center; gap: .8rem; } aside .brand-logo { width: 116px; padding: .2rem .4rem; flex-shrink: 0; } .layout { grid-template-columns: 1fr; } aside { padding: .8rem 1rem; gap: .7rem; } nav { display: flex; flex-wrap: wrap; } nav a { padding: .4rem .55rem; } .account { display: flex; align-items: center; gap: .7rem; } .account small { margin: 0; } .account button { margin-left: auto; } }
@media (max-width: 650px) { .split, .form-list { grid-template-columns: 1fr; } .page-header { flex-wrap: wrap; margin-bottom: .7rem; } .metrics { gap: .45rem; } .sale-line { grid-template-columns: 1fr 1fr; } .sale-line label:first-child { grid-column: 1 / -1; } .line-input { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .line-input button { justify-self: start; } }
.cell-label { display: none; }
@media (max-width: 650px) {
  .table-scroll table, .table-scroll tbody, .table-scroll tr { display: block; }
  .table-scroll thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .table-scroll tr { border: 1px solid var(--border); border-radius: .55rem; margin: .65rem 0; padding: .35rem .65rem; }
  .table-scroll td { display: grid; grid-template-columns: minmax(5.1rem, 1fr) minmax(0, 2fr); gap: .55rem; padding: .4rem 0; border: 0; }
  .cell-label { display: block; font-size: .8rem; color: var(--muted); font-weight: 700; }
}
.pricing-card { margin-top: .8rem; padding: .65rem; background: #fff; border-radius: .55rem; }
.pricing-card h4 { margin: 0 0 .3rem; }
.pricing-card div { display: flex; justify-content: space-between; gap: .6rem; padding: .25rem 0; font-size: .86rem; }
.pricing-card button { margin-top: .35rem; }

.accessory-total { align-self: end; margin-bottom: .95rem; color: var(--muted); font-size: .86rem; white-space: nowrap; }

@media (min-width: 651px) { .accessory-line { grid-template-columns: minmax(0, 1.3fr) minmax(0, .65fr) minmax(0, 1fr) auto auto; } }
