/* Painel Bergh — sistema de demonstração. Claro, denso e calmo: é ferramenta, não vitrine. */
:root {
  --bg: #f4f4f2; --card: #fff; --ink: #121214; --mute: #6f6e6b; --line: #e3e2de; --line-2: #d4d3ce;
  --red: #e30613; --ok: #127a3a;
  --display: 'Archivo', 'Helvetica Neue', Arial, sans-serif; --ui: 'Geist', -apple-system, 'Segoe UI', Roboto, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 var(--ui); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
img { display: block; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }

.logo { display: inline-grid; justify-items: center; line-height: 1; gap: 1px; color: var(--ink); }
.logo svg { width: 54px; height: 10px; margin-bottom: -2px; }
.logo b { font-family: var(--display); font-stretch: 125%; font-weight: 900; font-size: 17px; color: var(--red); }
.logo small { font-size: 6.5px; letter-spacing: .42em; font-weight: 600; margin-right: -.42em; }

.p-top { position: sticky; top: 0; z-index: 20; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 20px; height: 64px; padding: 0 28px; background: rgba(255,255,255,.86); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.p-brand { display: flex; align-items: center; gap: 14px; }
.p-brand > span { padding-left: 14px; border-left: 1px solid var(--line-2); font-weight: 600; }
.p-tabs { display: flex; gap: 4px; background: #ecebe8; padding: 3px; border-radius: 10px; }
.p-tabs button { border: 0; background: none; padding: 7px 16px; border-radius: 8px; cursor: pointer; color: var(--mute); font-weight: 500; }
.p-tabs button[aria-selected=true] { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.p-user { justify-self: end; display: flex; align-items: center; gap: 12px; font-size: 14px; }
.p-user a { color: var(--mute); margin-right: 8px; }
.p-user a:hover { color: var(--ink); }
.p-user img { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; }

.p-demo { max-width: 1240px; margin: 20px auto 0; padding: 12px 16px; background: #fff7e0; border: 1px solid #f0dfae; border-radius: 10px; font-size: 14px; color: #6b5310; }
.p-main { max-width: 1240px; margin: 0 auto; padding: 24px 28px 120px; }

.p-stats { display: grid; grid-template-columns: repeat(4, 1fr); background: var(--card); border: 1px solid var(--line); border-radius: 14px; }
.p-stats div { padding: 18px 20px; }
.p-stats div + div { border-left: 1px solid var(--line); }
.p-stats span { display: block; color: var(--mute); font-size: 13px; }
.p-stats b { font-family: var(--display); font-stretch: 110%; font-size: 28px; font-weight: 720; letter-spacing: -.03em; }

.p-bar { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin: 26px 0 12px; }
.p-search { width: min(420px, 100%); height: 42px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: 10px; background: #fff; }
.p-link { border: 0; background: none; color: var(--mute); cursor: pointer; padding: 6px 4px; font-size: 14px; }
.p-link:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

.p-table { background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.p-row { display: grid; grid-template-columns: minmax(260px, 2.2fr) 1fr minmax(250px, 1.5fr) 150px 120px; align-items: center; gap: 16px; padding: 12px 20px; border-top: 1px solid var(--line); }
.p-head { border-top: 0; background: #fafaf8; color: var(--mute); font-size: 12.5px; padding-block: 10px; }
.p-car { display: flex; align-items: center; gap: 14px; min-width: 0; }
.p-car img { width: 58px; height: 58px; object-fit: cover; border-radius: 8px; background: var(--bg); flex: none; }
.p-car b { display: block; font-weight: 600; }
.p-car span, .p-meta span { display: block; color: var(--mute); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-price { display: flex; align-items: center; gap: 8px; }
.p-money { display: flex; align-items: center; height: 40px; border: 1px solid var(--line-2); border-radius: 9px; background: #fff; padding-left: 11px; width: 150px; transition: border-color .2s, box-shadow .2s; }
.p-money:focus-within { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(18,18,20,.08); }
.p-money i { font-style: normal; color: var(--mute); font-size: 13px; }
.p-money input { border: 0; outline: 0; background: none; width: 100%; height: 100%; padding: 0 10px 0 6px; font-weight: 600; font-variant-numeric: tabular-nums; }
.p-money input::placeholder { font-weight: 400; color: #9b9a96; }
.p-save { height: 34px; padding: 0 12px; border: 0; border-radius: 8px; background: var(--ink); color: #fff; font-weight: 600; font-size: 13px; cursor: pointer; opacity: 0; pointer-events: none; transform: translateX(-4px); transition: opacity .2s, transform .2s; }
.p-price.dirty .p-save { opacity: 1; pointer-events: auto; transform: none; }
.p-price em { font-style: normal; font-size: 12px; color: var(--ok); font-weight: 600; }
.p-price.dirty em { display: none; }
.p-status { height: 36px; border: 1px solid var(--line-2); border-radius: 9px; background: #fff; padding: 0 8px; width: 100%; }
.p-acts { display: flex; gap: 10px; justify-content: end; }

.p-form { max-width: 820px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 32px; }
.p-form h1 { margin: 0; font-family: var(--display); font-stretch: 110%; font-weight: 740; font-size: 30px; letter-spacing: -.03em; }
.p-sub { color: var(--mute); margin: 6px 0 26px; }
.p-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.p-grid label { display: grid; gap: 6px; font-size: 13px; color: var(--mute); }
.p-grid .wide { grid-column: 1 / -1; }
.p-grid input, .p-grid select, .p-grid textarea { height: 42px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 10px; background: #fff; color: var(--ink); font-size: 15px; }
.p-grid textarea { height: auto; padding: 10px 12px; resize: vertical; }
.p-drop { margin-top: 18px; display: grid; place-items: center; gap: 4px; padding: 30px; border: 1.5px dashed var(--line-2); border-radius: 14px; cursor: pointer; text-align: center; color: var(--mute); transition: border-color .2s, background-color .2s; }
.p-drop:hover { border-color: var(--ink); background: #fafaf8; }
.p-drop b { color: var(--ink); }
.p-drop input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.p-previews { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; margin-top: 12px; }
.p-previews figure { margin: 0; position: relative; }
.p-previews img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; }
.p-previews span { position: absolute; left: 6px; top: 6px; background: var(--red); color: #fff; font-size: 11px; font-weight: 600; padding: 2px 6px; border-radius: 4px; }
.p-actions { display: flex; gap: 10px; margin-top: 24px; }
.p-btn { display: inline-flex; align-items: center; height: 44px; padding: 0 20px; border: 0; border-radius: 10px; background: var(--ink); color: #fff; font-weight: 600; cursor: pointer; }
.p-btn:hover { background: #000; }
.p-btn.ghost { background: #fff; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-2); }

.p-drawer { position: fixed; inset: 0; z-index: 40; }
.p-scrim { position: absolute; inset: 0; background: rgba(10,10,11,.32); animation: fade .25s ease both; }
.p-sheet { position: absolute; top: 0; right: 0; bottom: 0; width: min(520px, 100%); background: #fff; padding: 24px 28px; overflow-y: auto; box-shadow: -20px 0 60px rgba(0,0,0,.12); animation: slide .35s cubic-bezier(.16,1,.3,1) both; }
.p-sheet header { display: flex; justify-content: space-between; align-items: center; }
.p-sheet h2 { margin: 0; font-family: var(--display); font-stretch: 110%; font-weight: 740; font-size: 26px; letter-spacing: -.03em; }
.p-x { border: 0; background: #f0efec; width: 34px; height: 34px; border-radius: 50%; font-size: 20px; line-height: 1; cursor: pointer; }
.p-sheet > img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 12px; margin: 18px 0 20px; }
.price-field input { font-weight: 700; font-size: 18px; border-color: var(--ink) !important; }
@keyframes fade { from { opacity: 0; } }
@keyframes slide { from { transform: translateX(40px); opacity: 0; } }

.p-toast { position: fixed; left: 50%; bottom: 28px; z-index: 60; max-width: min(560px, calc(100% - 32px)); padding: 14px 18px; border-radius: 12px; background: var(--ink); color: #fff; font-size: 14.5px; box-shadow: 0 12px 40px rgba(0,0,0,.25); transform: translate(-50%, 20px); opacity: 0; pointer-events: none; transition: transform .35s cubic-bezier(.16,1,.3,1), opacity .25s; }
.p-toast.on { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }
.p-toast a { color: #fff; text-decoration: underline; text-underline-offset: 3px; margin-left: 6px; font-weight: 600; }

@media (max-width: 900px) {
  .p-top { grid-template-columns: 1fr auto; padding: 0 16px; }
  .p-tabs { grid-column: 1 / -1; grid-row: 2; justify-self: start; margin-bottom: 10px; }
  .p-top { height: auto; padding-top: 12px; }
  .p-user span, .p-user img { display: none; }
  .p-demo { margin: 14px 16px 0; }
  .p-main { padding: 18px 16px 100px; }
  .p-stats { grid-template-columns: 1fr 1fr; }
  .p-stats div:nth-child(3) { border-left: 0; }
  .p-stats div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .p-head { display: none; }
  .p-row { grid-template-columns: 1fr auto; gap: 10px 12px; padding: 14px 16px; }
  .p-car { grid-column: 1 / -1; }
  .p-meta { display: none; }
  .p-price { grid-column: 1 / -1; }
  .p-acts { grid-column: 2; grid-row: 3; }
  .p-form { padding: 22px 18px; }
  .p-grid { grid-template-columns: 1fr; }
}
