/* Inventário — design tokens from design_handoff_inventario/README.md */
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: #000000;
  color: #eceae8;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", sans-serif;
  font-size: 0.875rem;
  line-height: 1.5;
  padding: 0;
}
a { color: rgb(56, 97, 149); text-decoration: none; }
a:hover { color: rgb(86, 132, 190); }
::selection { background: rgba(56, 97, 149, 0.35); }

/* Top bar */
.topbar { height: 64px; background: #222020; border-bottom: 1px solid #3a3736; display: flex; align-items: center; padding: 0 32px; gap: 24px; position: sticky; top: 0; z-index: 10; }
.brand { display: flex; align-items: center; gap: 10px; color: #ffffff; font-weight: 600; font-size: 1rem; white-space: nowrap; }
.brand-mark { width: 32px; height: 32px; background: rgb(56, 97, 149); display: flex; align-items: center; justify-content: center; color: #fff; font-size: 1.1rem; }
.topbar-search { flex: 1; max-width: 560px; display: flex; align-items: center; background: #373433; border: 1px solid #3a3736; padding: 9px 14px; transition: border-color 120ms; }
.topbar-search:focus-within { border-color: rgb(56, 97, 149); box-shadow: 0 0 0 .25rem rgba(56, 97, 149, 0.25); }
.topbar-search input { background: none; border: none; color: #eceae8; flex: 1; font-size: 0.9rem; outline: none; }
.topbar-search input::placeholder { color: #6e6b69; }
.topbar-search i { color: rgb(56, 97, 149); margin-right: 10px; }
.btn-post { background: rgb(56, 97, 149); color: #fff; border: none; padding: 10px 20px; font-size: 0.875rem; font-weight: 600; display: flex; align-items: center; gap: 8px; cursor: pointer; transition: background 120ms; white-space: nowrap; }
.btn-post:hover { background: rgb(46, 82, 128); color: #fff; }
.user-menu { position: relative; margin-left: auto; flex-shrink: 0; }
.user-chip { display: flex; align-items: center; gap: 10px; cursor: pointer; flex-shrink: 0; background: none; border: none; padding: 0; }
.user-chip:hover .user-name { color: #a9c1df; }
.user-name { color: #eceae8; font-size: 0.875rem; font-weight: 500; white-space: nowrap; }
.user-avatar { width: 32px; height: 32px; border-radius: 50%; background: rgb(56, 97, 149); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 0.75rem; font-weight: 600; flex-shrink: 0; }
.user-menu-dropdown {
  display: none; position: absolute; top: calc(100% + 10px); right: 0; min-width: 200px;
  background: #222020; border: 1px solid #3a3736; z-index: 20; flex-direction: column; padding: 6px;
}
.user-menu.open .user-menu-dropdown { display: flex; }
.user-menu-dropdown a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; color: #eceae8; font-size: 0.875rem; white-space: nowrap; }
.user-menu-dropdown a:hover { background: #373433; color: #eceae8; }
.user-menu-dropdown i { color: rgb(56, 97, 149); width: 16px; text-align: center; }

.layout { margin: 0 auto; padding: 32px; display: grid; grid-template-columns: 260px 1fr; gap: 32px; align-items: start; }

/* Sidebar filters */
.sidebar { background: #222020; border: 1px solid #3a3736; padding: 24px; position: sticky; top: 96px; overflow: hidden; }
.sidebar-section { margin-bottom: 28px; }
.sidebar-section:last-child { margin-bottom: 0; }
.sidebar-eyebrow { font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.05em; color: #9a9694; font-weight: 600; margin-bottom: 14px; }
.cat-list { display: flex; flex-direction: column; gap: 2px; }
.cat-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; color: #eceae8; background: none; border: none; text-align: left; font-size: 0.875rem; cursor: pointer; transition: all 120ms; width: 100%; }
.cat-item i { color: rgb(56, 97, 149); width: 16px; text-align: center; }
.cat-item:hover { background: #373433; color: #eceae8; }
.cat-item.active { background: rgba(56, 97, 149, 0.18); color: #ffffff; border-left: 3px solid rgb(56, 97, 149); padding-left: 7px; }

.city-select { width: 100%; background: #373433; border: 1px solid #3a3736; color: #eceae8; padding: 9px 10px; font-size: 0.875rem; }
.city-select:focus { border-color: rgb(56, 97, 149); outline: none; box-shadow: 0 0 0 .25rem rgba(56, 97, 149, 0.25); }

.slider-row { display: flex; flex-direction: column; gap: 10px; }
.dist-slider { width: 100%; height: 32px; accent-color: rgb(56, 97, 149); background: transparent; cursor: pointer; -webkit-appearance: none; appearance: none; }
.dist-slider::-webkit-slider-runnable-track { height: 6px; background: #373433; border: 1px solid #3a3736; }
.dist-slider::-moz-range-track { height: 6px; background: #373433; border: 1px solid #3a3736; }
.dist-slider::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; background: rgb(56, 97, 149); border: 2px solid #eceae8; margin-top: -7px; cursor: pointer; }
.dist-slider::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: rgb(56, 97, 149); border: 2px solid #eceae8; cursor: pointer; }
.slider-value { font-size: 0.8125rem; color: #9a9694; }
.slider-value strong { color: #eceae8; }

.legend-list { display: flex; flex-direction: column; gap: 8px; }
.legend-row { display: flex; align-items: center; gap: 8px; font-size: 0.8125rem; color: #eceae8; }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }

.map-wrapper { width: 100%; aspect-ratio: 2 / 3; border: 1px solid #3a3736; overflow: hidden; background: #373433; }
.map-frame { width: 100%; height: 100%; border: 0; background: #1a1a1a; }
.leaflet-control-attribution { background: rgba(34, 32, 32, 0.75) !important; color: #9a9694 !important; font-size: 0.625rem !important; }
.leaflet-control-attribution a { color: rgb(86, 132, 190) !important; }

/* Main content */
.content-header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 20px; flex-wrap: wrap; gap: 12px; }
.page-title { font-size: 1.75rem; font-weight: 300; color: #ffffff; margin: 0 0 4px 0; }
.page-subtitle { color: #9a9694; font-size: 0.875rem; margin: 0; }
.result-count { color: #9a9694; font-size: 0.8125rem; }
.result-count strong { color: #eceae8; }

.sort-row { display: flex; align-items: center; gap: 8px; }
.sort-select { background: #373433; border: 1px solid #3a3736; color: #eceae8; padding: 7px 10px; font-size: 0.8125rem; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; }

.item-card { background: #222020; border: 1px solid #3a3736; overflow: hidden; cursor: pointer; transition: border-color 120ms, transform 120ms; display: block; color: inherit; }
.item-card:hover { border-color: rgb(56, 97, 149); transform: translateY(-2px); color: inherit; }

.item-image-wrapper { width: 100%; padding-bottom: 92%; position: relative; background: #373433; overflow: hidden; }
.item-image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.image-placeholder { position: absolute; inset: 0; background: #373433; display: flex; align-items: center; justify-content: center; color: #6e6b69; font-size: 1.75rem; }

.item-badge { position: absolute; top: 8px; left: 8px; background: rgba(34,32,32,0.85); backdrop-filter: blur(2px); border: 1px solid #3a3736; color: #a9c1df; padding: 3px 8px; font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.04em; }
.item-condition { position: absolute; top: 8px; right: 8px; padding: 3px 8px; font-size: 0.6875rem; font-weight: 600; }

.item-content { padding: 14px; }
.item-title { font-size: 0.9rem; font-weight: 600; color: #ffffff; margin: 0 0 8px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-meta-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.item-location { display: flex; align-items: center; gap: 5px; color: #9a9694; font-size: 0.78125rem; min-width: 0; }
.item-location span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-location i { color: rgb(56, 97, 149); flex-shrink: 0; }
.item-distance { color: #6e6b69; font-size: 0.75rem; flex-shrink: 0; }

.empty-state { text-align: center; padding: 80px 32px; color: #9a9694; grid-column: 1 / -1; }
.empty-state i { font-size: 2.5rem; color: rgb(56, 97, 149); margin-bottom: 16px; display: block; }
.empty-state-title { font-size: 1.0625rem; color: #eceae8; margin-bottom: 6px; }

.footer { margin: 0 auto; padding: 24px 32px; border-top: 1px solid #3a3736; display: flex; justify-content: space-between; align-items: center; color: #6e6b69; font-size: 0.8125rem; flex-wrap: wrap; gap: 8px; }

/* Pagination */
.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 32px; }
.pagination a, .pagination span { padding: 8px 14px; border: 1px solid #3a3736; color: #eceae8; background: #222020; }
.pagination a:hover { border-color: rgb(56, 97, 149); color: #eceae8; }
.pagination .current { background: rgb(56, 97, 149); border-color: rgb(56, 97, 149); color: #fff; }

/* Forms (item create/edit) */
.form-card { background: #222020; border: 1px solid #3a3736; padding: 32px; max-width: 640px; margin: 0 auto; }
.form-group { margin-bottom: 20px; }
.form-label { display: block; font-size: 0.8125rem; color: #9a9694; margin-bottom: 8px; font-weight: 600; }
.form-control, select.form-control, textarea.form-control {
  width: 100%; background: #373433; border: 1px solid #3a3736; color: #eceae8;
  padding: 10px 12px; font-size: 0.875rem; font-family: inherit;
}
.form-control:focus { border-color: rgb(56, 97, 149); outline: none; box-shadow: 0 0 0 .25rem rgba(56, 97, 149, 0.25); }
textarea.form-control { resize: vertical; min-height: 120px; }
.form-errors { color: #ff8f8f; font-size: 0.8125rem; margin-top: 6px; }
.form-actions { display: flex; gap: 12px; margin-top: 28px; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 20px; font-size: 0.875rem; font-weight: 600; border: 1px solid #3a3736; cursor: pointer; background: #373433; color: #eceae8; transition: all 120ms; }
.btn:hover { background: #454140; color: #eceae8; }
.btn-primary { background: rgb(56, 97, 149); border-color: rgb(56, 97, 149); color: #fff; }
.btn-primary:hover { background: rgb(46, 82, 128); color: #fff; }
.btn-danger { background: #dc3545; border-color: #dc3545; color: #fff; }
.btn-danger:hover { background: #b02a37; color: #fff; }

.page-title-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }

/* Item detail */
.detail-layout { max-width: 900px; margin: 0 auto; padding: 32px; }
.detail-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; margin-bottom: 24px; }
.detail-photos img { width: 100%; aspect-ratio: 1; object-fit: cover; border: 1px solid #3a3736; }
.detail-card { background: #222020; border: 1px solid #3a3736; padding: 28px; }
.detail-meta { display: flex; gap: 16px; flex-wrap: wrap; margin: 16px 0; color: #9a9694; font-size: 0.8125rem; }
.detail-actions { display: flex; gap: 12px; margin-top: 24px; flex-wrap: wrap; }
.alert { padding: 12px 16px; margin-bottom: 20px; border: 1px solid #3a3736; background: #373433; color: #eceae8; }
.alert-success { border-color: #198754; }
.alert-error { border-color: #dc3545; }

/* Login card (allauth override) */
.login-wrapper { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-card { width: 100%; max-width: 400px; background: #222020; border: 1px solid #3a3736; padding: 40px 36px; }
.brand-block { text-align: center; margin-bottom: 32px; }
.brand-title { color: #ffffff; font-size: 1.25rem; font-weight: 600; margin: 0 0 6px 0; }
.brand-subtitle { color: #9a9694; font-size: 0.8125rem; margin: 0; }
.divider-text { text-align: center; color: #6e6b69; font-size: 0.8125rem; margin: 4px 0 24px 0; }
.btn-google { width: 100%; display: flex; align-items: center; justify-content: center; gap: 12px; background: #ffffff; color: #212529; border: 1px solid #3a3736; padding: 12px 16px; font-size: 0.9375rem; font-weight: 500; cursor: pointer; transition: background 120ms; }
.btn-google:hover { background: #ececec; color: #212529; }
.btn-google svg { width: 20px; height: 20px; flex-shrink: 0; }
.fine-print { text-align: center; color: #6e6b69; font-size: 0.75rem; margin-top: 24px; line-height: 1.6; }
.fine-print a { color: rgb(56, 97, 149); }
.back-link { display: flex; align-items: center; gap: 6px; color: #9a9694; font-size: 0.8125rem; margin-bottom: 28px; }
.back-link:hover { color: #a9c1df; }
.back-link i { font-size: 0.9rem; }

@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; padding: 16px; gap: 20px; }
  .sidebar { position: static; padding: 18px; }
  .topbar { padding: 12px 16px; flex-wrap: wrap; height: auto; row-gap: 10px; }
  .topbar-search { order: 3; max-width: none; flex-basis: 100%; }
  .btn-post { padding: 10px 16px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
  .content-header { flex-direction: column; align-items: flex-start; }
  .sort-row { width: 100%; justify-content: space-between; }
}
@media (max-width: 480px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .page-title { font-size: 1.375rem; }
  .brand span { font-size: 0.9375rem; }
  .user-name { display: none; }
}
