/* Панель каталога. Общие цвета и кнопки — в loverosa/ (копия design/, руками не править). */
body { min-height: 100vh; }
.small { font-size: 13px; }
.spacer { flex: 1; }
.link { border: 0; background: none; padding: 4px 0; color: var(--soft); text-decoration: underline; cursor: pointer; font-size: 13px; }
.error { margin: 0; color: var(--danger); font-size: 14px; }
input:not([type=checkbox]), select, textarea { width: 100%; min-height: 44px; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--r-field); background: var(--paper); font-size: 15px; }
textarea { min-height: 80px; resize: vertical; }
.btn { min-height: 42px; padding: 0 20px; font-size: 12px; }

/* вход */
.login { display: grid; place-items: center; min-height: 100vh; padding: 16px; }
.login-card { display: grid; gap: 16px; width: 100%; max-width: 360px; padding: 32px 24px; background: var(--paper); border-radius: var(--r-panel); box-shadow: 0 1px 0 var(--line); }
.login-logo { height: 64px; margin: 0 auto 4px; }

/* шапка */
.top { position: sticky; top: 0; z-index: 5; padding: 12px 16px; background: rgba(251, 250, 248, .94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.top-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; max-width: 1280px; margin: 0 auto; }
.top-row + .top-row { margin-top: 10px; }
.top-logo { height: 16px; }
.top-title { font: 500 22px/1 var(--serif); }

.summary { display: flex; gap: 10px; flex-wrap: wrap; max-width: 1280px; margin: 16px auto 0; padding: 0 16px; }
.stat { padding: 10px 14px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-field); }
.stat b { display: block; font: 500 24px/1.1 var(--serif); }
.stat span { font-size: 12px; color: var(--muted); }
.stat.warn { background: var(--warning-bg); border-color: transparent; }

.filters { max-width: 1280px; margin: 16px auto 0; padding: 0 16px; display: grid; gap: 10px; }
.pills { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; }
.filter-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.filter-row input[type=search] { flex: 2 1 200px; width: auto; }
.filter-row select { flex: 1 1 160px; width: auto; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--soft); cursor: pointer; }

/* карточки */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; max-width: 1280px; margin: 16px auto 40px; padding: 0 16px; }
.tile { display: grid; grid-template-rows: auto 1fr; padding: 0; border: 0; text-align: left; background: var(--paper); border-radius: var(--r-img); overflow: hidden; box-shadow: 0 0 0 1px var(--line); cursor: pointer; transition: box-shadow .2s var(--ease), transform .2s var(--ease); }
.tile:hover { box-shadow: 0 0 0 1px var(--graphite); }
.tile.archived { opacity: .55; }
.ph { position: relative; aspect-ratio: 4 / 5; background: var(--surface); }
.ph img { width: 100%; height: 100%; object-fit: cover; }
.ph .noimg { display: grid; place-items: center; height: 100%; color: var(--placeholder); font-size: 13px; }
.ph .chips { position: absolute; left: 8px; top: 8px; right: 8px; display: flex; gap: 4px; flex-wrap: wrap; }
.tile-body { display: grid; gap: 4px; padding: 10px 12px 12px; align-content: start; }
.tile-title { display: flex; justify-content: space-between; gap: 8px; font-weight: 600; }
.tile-price { white-space: nowrap; }
.tile-meta { font-size: 12px; color: var(--muted); }

.chip { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 11px; font-weight: 600; background: var(--paper); color: var(--soft); box-shadow: 0 0 0 1px var(--line); white-space: nowrap; }
.chip.new { background: var(--warning-bg); color: var(--warning); box-shadow: none; }
.chip.confirmed { background: #e6efe8; color: var(--ok); box-shadow: none; }
.chip.archived { background: var(--surface); color: var(--muted); box-shadow: none; }
.chip.site { background: var(--graphite); color: #fff; box-shadow: none; }
.chip.pending { background: var(--accent); color: var(--accent-deep); box-shadow: none; }
.chip.est { background: var(--danger-bg); color: var(--danger); box-shadow: none; }
.empty { text-align: center; }

/* окно букета */
dialog { padding: 0; border: 0; color: var(--ink); background: var(--bg); }
dialog::backdrop { background: rgba(29, 29, 31, .35); }
.sheet { width: min(760px, 100vw); max-width: 100vw; height: 100vh; max-height: 100vh; margin: 0 0 0 auto; border-radius: 0; }
.sheet-in { display: grid; gap: 18px; padding: 16px 16px 40px; }
.sheet-head { display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 2; margin: -16px -16px 0; padding: 12px 16px; background: var(--bg); border-bottom: 1px solid var(--line); }
.sheet-head h2 { margin: 0; font: 500 26px/1.1 var(--serif); flex: 1; }
.cols { display: grid; grid-template-columns: 220px 1fr; gap: 18px; }
.cols .ph { border-radius: var(--r-img); overflow: hidden; }
.block { display: grid; gap: 10px; padding: 16px; background: var(--paper); border-radius: var(--r-panel); box-shadow: 0 0 0 1px var(--line); }
.block h3 { margin: 0; font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.seg { display: inline-flex; padding: 3px; background: var(--surface); border-radius: 999px; flex-wrap: wrap; }
.seg button { border: 0; background: none; padding: 8px 14px; border-radius: 999px; font-size: 13px; font-weight: 500; color: var(--soft); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--paper); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; }
.notice { margin: 0; padding: 10px 14px; border-radius: var(--r-field); background: var(--warning-bg); color: var(--warning); font-size: 14px; }
.notice.pink { background: var(--accent); color: var(--accent-deep); }

table.comp { width: 100%; border-collapse: collapse; font-size: 14px; }
.comp td, .comp th { padding: 8px 6px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.comp th { font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.comp .num { text-align: right; white-space: nowrap; }
.comp tfoot td { border: 0; font-weight: 600; }
.comp input[type=number] { width: 76px; min-height: 38px; padding: 6px 8px; text-align: right; }
.comp select { min-height: 38px; padding: 6px 8px; }
.x { border: 0; background: none; color: var(--muted); font-size: 18px; cursor: pointer; padding: 4px 8px; }
.x:hover { color: var(--danger); }
.price-big { font: 500 28px/1 var(--serif); }
.hist { display: grid; gap: 6px; font-size: 13px; }
.hist div { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.pre { white-space: pre-line; font-size: 14px; color: var(--soft); margin: 0; }

.modal { width: min(440px, calc(100vw - 32px)); border-radius: var(--r-panel); }
.modal-in { display: grid; gap: 14px; padding: 22px; }
.modal-in h2 { margin: 0; font: 500 24px/1.1 var(--serif); }
.cat-row { display: flex; gap: 8px; align-items: center; }
.cat-row input { flex: 1; }

.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 50; max-width: calc(100vw - 32px); padding: 12px 18px; border-radius: var(--r-field); background: var(--graphite); color: #fff; font-size: 14px; }
.toast.bad { background: var(--danger); }

@media (max-width: 640px) {
  .cols { grid-template-columns: 1fr; }
  .cols .ph { max-width: 240px; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .top-row.actions .btn { flex: 1 1 auto; padding: 0 12px; }
  .comp input[type=number] { width: 60px; }
}
