:root {
    font-family: "Segoe UI", system-ui, sans-serif;
    color: #222b26;
    background: #f4f6f1;
    font-size: 16px;
    line-height: 1.45;
    --muted: #535f57;
    --line: #dce4db;
    --accent: #28513e;
    --ink: #182c22;
    --tint: #e4eee3;
    --white: #fff;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .55; }
:focus-visible { outline: 3px solid #5b876e; outline-offset: 3px; }
a { color: var(--accent); }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(1.9rem,4vw,2.55rem); line-height: 1.12; letter-spacing: -.05em; color: var(--ink); }
h2 { font-size: 1.2rem; letter-spacing: -.025em; color: var(--ink); }
h3 { font-size: 1rem; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.loading { margin: 2rem; color: var(--muted); }
.layout { min-height: 100svh; display: grid; grid-template-columns: 232px minmax(0,1fr); }
.sidebar { background: #203a2d; color: #f4f8f2; padding: 29px 19px 20px; display: flex; flex-direction: column;
    gap: clamp(14px,5svh,36px); position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; justify-content: center; background: #fcfcf7; border-radius: 11px;
    padding: 6px 7px; text-decoration: none; flex-shrink: 0; }
.brand-logo { display: block; max-width: 100%; width: 100%; height: auto; }
.menu-toggle { display: none; }
.sidebar nav { display: grid; gap: 6px; }
.sidebar nav a { color: #dbe7dc; text-decoration: none; padding: 11px 12px; border-radius: 8px; display: flex; align-items: center; gap: 11px; font-size: .93rem; font-weight: 600; white-space: nowrap; }
.sidebar nav a:hover { background: #2f5040; }
.sidebar nav a[aria-current="page"] { background: #3b624d; color: #fff; }
.icon { display: inline-grid; width: 19px; place-items: center; font-size: 1.15rem; line-height: 1; font-family: system-ui, sans-serif; }
.account { margin-top: auto; display: flex; gap: 10px; align-items: center; border-top: 1px solid #496150; padding-top: 17px; }
.account-link { min-width: 0; flex: 1; display: flex; align-items: center; gap: 9px; text-decoration: none; color: inherit;
    border-radius: 8px; padding: 4px; }
.account-link:hover, .account-link[aria-current="page"] { background: #3b624d; }
.avatar { display: grid; place-items: center; flex: none; width: 35px; height: 35px; border-radius: 50%; background: #466550; color: #f3f8f1; font-size: .8rem; font-weight: 700; }
.account-info { flex: 1; min-width: 0; }
.account-info strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .875rem; }
.account-info small { color: #d2dfd1; }
.logout { border: 0; background: transparent; color: #edf5ed; padding: 6px; border-radius: 5px; }
.logout:hover { background: #3b624d; }
.workspace { width: 100%; max-width: 1500px; padding: 31px clamp(17px,3.2vw,52px) 45px; margin-inline: auto; }
.crumb { font-size: .875rem; color: var(--muted); margin-bottom: 24px; }
.page-head { display: flex; gap: 16px; justify-content: space-between; align-items: end; margin-bottom: 22px; }
.page-head p { margin-top: 8px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.button { display: inline-flex; gap: 8px; align-items: center; justify-content: center; min-height: 41px; padding: 8px 13px; border: 1px solid var(--line); border-radius: 8px; background: var(--white); color: #273c30; text-decoration: none; font-size: .9rem; font-weight: 650; white-space: nowrap; }
.button:hover { border-color: #849e89; background: #f2f6ef; }
.button.primary { border-color: var(--accent); background: var(--accent); color: #fff; }
.button.primary:hover { background: #1a402d; }
.button.danger { color: #9c3035; }
.panel { border: 1px solid var(--line); border-radius: 13px; background: #fff; box-shadow: 0 2px 5px #1f322306; min-width: 0; }
.filter { padding: 13px; display: flex; align-items: end; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.filter label { flex: 1 1 130px; }
.filter .search { flex: 3 1 220px; }
label { display: grid; gap: 5px; font-size: .875rem; font-weight: 650; color: #35473b; min-width: 0; }
input, select, textarea { color: #22362a; width: 100%; min-width: 0; border: 1px solid #d1dcd2; background-color: #fff; padding: 8px 10px; min-height: 41px; border-radius: 7px; font-size: .94rem; }
select { appearance: none; padding-right: 28px; background: linear-gradient(45deg,transparent 50%,#587568 50%) calc(100% - 15px) 53%/5px 5px no-repeat, linear-gradient(135deg,#587568 50%,transparent 50%) calc(100% - 10px) 53%/5px 5px no-repeat,#fff; }
textarea { resize: vertical; }
.metrics { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 13px; margin-bottom: 16px; }
.metric { padding: 17px; }
.metric-icon { display: grid; place-items: center; width: 36px; height: 36px; color: #28513e; background: #e4eee3; border-radius: 9px; margin-bottom: 10px; }
.metric:nth-child(2) .metric-icon { background: #e3f7ee; color: #166a4a; }
.metric:nth-child(3) .metric-icon { background: #e9eee8; color: #3a6756; }
.metric:nth-child(4) .metric-icon { background: #f5eddb; color: #885b13; }
.metric span:nth-last-child(2) { color: var(--muted); display: block; font-size: .875rem; }
.metric strong { color: var(--ink); display: block; font-weight: 770; font-size: clamp(1.1rem,2vw,1.53rem); overflow-wrap: anywhere; letter-spacing: -.035em; margin-top: 3px; }
.split { display: grid; grid-template-columns: minmax(0,1.65fr) minmax(0,1fr); gap: 16px; margin-bottom: 16px; }
.panel-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 15px 17px; }
.panel-heading p { margin-top: 3px; }
.chart { display: flex; align-items: stretch; gap: clamp(3px,1vw,16px); height: 192px; padding: 0 17px 11px; }
.bar { display: grid; grid-template-rows: 1fr auto; gap: 6px; justify-items: center; flex: 1 1 0; min-width: 0; color: var(--muted); font-size: .8rem; }
.bar-track { width: 100%; display: flex; align-items: end; justify-content: center; border-bottom: 1px solid var(--line); background: repeating-linear-gradient(to top,transparent 0,transparent calc(25% - 1px),#eef3ed calc(25% - 1px),#eef3ed 25%); }
.bar-fill { display: block; height: var(--height,0%); width: min(62%,52px); border-radius: 6px 6px 0 0; background: linear-gradient(#6c9b78,#35634a); }
.segments { display: grid; gap: 14px; padding: 0 17px 18px; }
.segment-info { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 3px 8px; font-size: .875rem; }
meter { display: block; appearance: none; width: 100%; height: 9px; margin: 6px 0 4px; }
meter::-webkit-meter-bar { border: 0; background: #e8eee7; border-radius: 10px; }
meter::-webkit-meter-optimum-value { background: #527d60; border-radius: 10px; }
meter::-moz-meter-bar { background: #527d60; border-radius: 10px; }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: .875rem; }
th { background: #f2f6ef; color: #495c50; font-weight: 650; font-size: .84rem; text-align: left; white-space: nowrap; }
th, td { padding: 11px 12px; border-bottom: 1px solid #e9efe7; vertical-align: middle; }
th:first-child, td:first-child { padding-left: 17px; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #f7faf5; }
td strong { font-size: .9rem; }
.numeric { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.text-button { background: none; border: none; color: var(--accent); font-weight: 700; padding: 4px 0; }
.text-button:hover { text-decoration: underline; }
.status { display: inline-flex; padding: 3px 8px; border-radius: 99px; background: #e8eee7; color: #395d48; font-size: .8rem; font-weight: 700; white-space: nowrap; }
.status.faturado { color: #136544; background: #e3f6ed; }
.status.aberto { color: #81531a; background: #fcf1da; }
.status.cancelado { color: #8b3c42; background: #faeaeb; }
.empty { padding: 21px 17px; color: var(--muted); }
.pager { border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 15px; }
.login { min-height: 100svh; padding: 25px; display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); background: #fff; }
.login aside { display: flex; flex-direction: column; justify-content: space-between; min-height: 500px; overflow: hidden; position: relative; padding: clamp(23px,5vw,68px); border-radius: 19px; background: radial-gradient(ellipse at 77% 56%,#355342,transparent 65%),#20362a; color: #fff; }
.login aside::after { content: ""; width: min(440px,75%); aspect-ratio: 1; position: absolute; right: -8%; top: 21%; transform: rotate(-19deg); border: 1px solid #ffffff25; background: repeating-linear-gradient(to top,#ffffff14 0,#ffffff14 1px,transparent 1px,transparent 22px),repeating-linear-gradient(to right,#ffffff14 0,#ffffff14 1px,transparent 1px,transparent 22px); border-radius: 40px; mask-image: linear-gradient(130deg,#000,#0000); }
.login-brand { align-self: flex-start; width: min(390px,100%); position: relative; z-index: 1; padding: 8px 16px; }
.login-intro { position: relative; z-index: 1; max-width: 410px; }
.login-intro p { color: #e3ece1; margin-top: 12px; }
.login-intro h2 { color: white; font-size: clamp(2rem,4.2vw,3.8rem); line-height: 1.02; letter-spacing: -.06em; }
.login main { display: grid; place-items: center; padding: clamp(20px,6vw,80px); }
.login form { width: min(100%,390px); display: grid; gap: 15px; }
.login form header { margin-bottom: 8px; }
.login form header p { margin-top: 9px; }
.login form button { width: 100%; }
.error { color: #952f38; background: #fff1f1; border-radius: 7px; padding: 9px 11px; }
#notice { position: fixed; z-index: 5; right: 18px; bottom: 18px; max-width: calc(100vw - 36px); padding: 12px 16px; border-radius: 9px; background: #203d2f; color: #fff; box-shadow: 0 4px 18px #203d2f33; }
dialog { width: min(820px,calc(100% - 24px)); max-height: calc(100svh - 32px); border: 1px solid var(--line); border-radius: 15px; color: #26382b; padding: 0; box-shadow: 0 14px 65px #1e362533; }
dialog::backdrop { background: #20382b80; }
.editor-head, .editor-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 15px 20px; position: sticky; background: #fff; z-index: 1; }
.editor-head { top: 0; border-bottom: 1px solid var(--line); }
.editor-foot { bottom: 0; border-top: 1px solid var(--line); justify-content: end; }
.editor-body { padding: 17px 20px; display: grid; gap: 16px; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 11px; }
.form-grid.three { grid-template-columns: repeat(3,minmax(0,1fr)); }
.wide { grid-column: 1/-1; }
.item { background: #f3f7f0; border: 1px solid var(--line); border-radius: 9px; padding: 10px; margin-bottom: 8px; }
.form-section { display: grid; gap: 9px; }
.form-section > header { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.form-section summary { cursor: pointer; font-weight: 700; }
details .form-grid { margin-top: 11px; }
.picked { display: flex; align-items: center; gap: 10px; min-height: 41px; flex-wrap: wrap; }
.matches { display: grid; gap: 3px; max-height: 152px; overflow: auto; margin-top: 5px; }
.matches button { justify-content: start; white-space: normal; text-align: left; }
.report-meta { margin: 0 0 13px; color: var(--muted); font-size: .875rem; }
.profile-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; align-items: start; }
.profile-panel { padding: 20px; }
.profile-panel h2 { margin-bottom: 14px; }
.profile-panel form { display: grid; gap: 13px; }
.profile-panel form .button { justify-self: start; }
.profile-panel dl { margin: 0; display: grid; gap: 10px; }
.profile-panel dl div { border-bottom: 1px solid var(--line); padding: 2px 0 10px; }
.profile-panel dt { color: var(--muted); font-size: .875rem; }
.profile-panel dd { margin: 3px 0 0; overflow-wrap: anywhere; }
.profile-callout { grid-column: 1/-1; background: var(--tint); border: 1px solid var(--line); padding: 11px 15px; border-radius: 8px; }
.android-panel { padding: 14px 17px; display: flex; justify-content: space-between; align-items: center; gap: 8px 14px; flex-wrap: wrap; margin-bottom: 16px; }
.android-panel p { margin-top: 4px; }
#catalog-preview ul { margin-block: 6px 0; }
.print-only { display: none; }
@media screen and (max-width: 1050px) {
    .layout { grid-template-columns: 188px minmax(0,1fr); }
    .sidebar { padding-inline: 12px; }
    .metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media screen and (max-width: 800px) {
    .layout { display: block; }
    .sidebar { display: grid; grid-template-columns: minmax(0,1fr) auto auto; padding: 9px 12px; gap: 6px;
        align-items: center; position: static; height: auto; overflow: visible; }
    .menu-toggle { grid-column: 3; grid-row: 1; display: flex; align-items: center; justify-content: center; gap: 6px;
        min-height: 42px; border: 1px solid #648273; background: #2f5040; color: #fff; border-radius: 8px;
        padding: 7px 9px; font-size: .875rem; font-weight: 650; }
    .menu-icon { display: inline-block; width: 14px; height: 10px; border-block: 1px solid currentColor;
        background: linear-gradient(currentColor,currentColor) center / 100% 1px no-repeat; }
    .menu-toggle[aria-expanded="true"] { background: #3b624d; }
    .sidebar nav { grid-column: 1/-1; grid-row: 2; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 4px; }
    .menu-toggle[aria-expanded="false"] + nav { display: none; }
    .sidebar nav a { justify-content: center; text-align: center; min-height: 42px; padding: 7px 3px; gap: 5px;
        font-size: .88rem; white-space: normal; overflow-wrap: anywhere; }
    .sidebar .brand { width: min(164px,100%); }
    .account { grid-column: 2; grid-row: 1; margin: 0; border: 0; padding: 0; gap: 3px; }
    .account-info { white-space: nowrap; }
    .account-info strong { display: none; }
    .workspace { padding-top: 17px; }
    .crumb { margin-bottom: 14px; }
    .page-head { align-items: start; flex-direction: column; margin-bottom: 15px; gap: 10px; }
    .split { grid-template-columns: 1fr; }
    .profile-grid { grid-template-columns: 1fr; }
    .chart { gap: 4px; padding-inline: 12px; }
    .bar { font-size: .75rem; }
    .data-print thead { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); }
    .data-print table, .data-print tbody, .data-print tr { display: block; }
    .data-print tr { border-top: 1px solid var(--line); padding: 7px 0; }
    .data-print td { display: flex; gap: 10px; justify-content: space-between; padding: 4px 14px; border: 0; }
    .data-print td:first-child { font-weight: 700; padding-left: 14px; }
    .data-print td:not(:first-child)::before { content: attr(data-label); color: var(--muted); text-align: left; }
    .catalog-panel thead { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); }
    .catalog-panel table, .catalog-panel tbody { display: block; }
    .catalog-panel tr { display: flex; flex-direction: column; border-top: 1px solid var(--line); padding: 7px 0; }
    .catalog-panel td { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; border: 0; padding: 4px 14px; }
    .catalog-panel td:nth-child(2) { order: -1; }
    .catalog-panel td[data-label]::before { content: attr(data-label); color: var(--muted); }
    .login { display: block; padding: 10px; }
    .login aside { min-height: 100px; padding: 18px; }
    .login-brand { width: min(280px,100%); align-self: center; }
    .login-intro { display: none; }
    .login main { padding: 40px 15px; }
}
@media screen and (max-width: 470px) {
    .sidebar nav .icon { display: none; }
    .account-link .avatar { display: none; }
    .form-grid.three { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .editor-body, .editor-head, .editor-foot { padding-inline: 12px; }
    .metrics { gap: 7px; }
    .metric { padding: 11px; }
}
@media print {
    @page { margin: 13mm; size: A4; }
    body { color: #141414; background: white; print-color-adjust: exact; }
    .sidebar,.crumb,.actions,.filter,.no-print,#notice,dialog { display: none !important; }
    .layout { display: block; }
    .workspace { width: 100%; padding: 0; }
    .print-only { display: block; }
    .metrics { grid-template-columns: repeat(4,minmax(0,1fr)); }
    .split { grid-template-columns: 1.5fr 1fr; }
    .panel { box-shadow: none; break-inside: avoid; }
    h1 { font-size: 26pt; }
    .data-print { break-inside: auto; }
    .data-print tr { break-inside: avoid; }
    .data-print th, .data-print td { padding: 5px; font-size: 8.5pt; }
    .data-print .table-wrap { overflow: visible; }
    .chart { gap: 4px; }
    .bar { font-size: 8pt; }
}
