/* ============================================================
   App shell — sidebar / topbar / views / right drawer
   Built on the dark-red palette from style.css
   ============================================================ */
.app-body { overflow: hidden; }

.app {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 252px minmax(0, 1fr);
  height: 100vh;
  min-height: 0;
}

/* ---------------------------------------------------------- sidebar */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 20px 14px 14px;
  background: linear-gradient(180deg, var(--surf-a), var(--surf-b));
  border-right: 1px solid var(--line);
  backdrop-filter: blur(8px);
  min-height: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 4px 8px 12px;
  text-decoration: none;
  color: var(--text);
  border-bottom: 1px solid var(--line);
}
.brand-mark {
  width: 36px; height: 36px;
  display: block;
  border-radius: 10px;
  object-fit: contain;
  flex: 0 0 auto;
  box-shadow: 0 2px 8px var(--shadow-c);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 14.5px; }
.brand-text small { font-size: 11px; color: var(--muted); letter-spacing: .09em; text-transform: uppercase; }

.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; min-height: 0; overflow-y: auto; }
.nav-label {
  margin: 14px 10px 6px;
  font-size: 10.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(154, 161, 173, .72);
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--text-dim);
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background .16s, color .16s, border-color .16s;
}
.nav-link:hover { background: var(--fill-1); color: var(--text); }
.nav-link.active {
  background: var(--fill-2);
  border-color: var(--line-strong);
  color: #fff;
  font-weight: 600;
  box-shadow: inset 0 1px 0 var(--line);
}
.nav-ico { width: 16px; height: 16px; flex: 0 0 auto; opacity: .62; }
#themeToggle svg { width: 16px; height: 16px; display: none; }
#themeToggle .ico-sun { display: block; }
[data-theme="light"] #themeToggle .ico-sun { display: none; }
[data-theme="light"] #themeToggle .ico-moon { display: block; }
.nav-link:hover .nav-ico { opacity: .85; }
.nav-link.active .nav-ico { opacity: 1; color: var(--accent-2); }

.side-foot { display: flex; flex-direction: column; gap: 10px; border-top: 1px solid var(--line); padding-top: 12px; }

.user-chip {
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  padding: 8px;
  border-radius: 12px;
  background: var(--fill-1);
  border: 1px solid var(--line);
  color: var(--text);
  cursor: pointer;
  text-align: left;
  font: inherit;
}
.user-chip:hover { border-color: var(--line-strong); background: var(--fill-1); }
.chip-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; flex: 1; }
.chip-text strong { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip-text small { font-size: 11px; color: var(--muted); }
.chip-chev { color: var(--muted); font-size: 18px; }

.avatar {
  display: grid; place-items: center;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--surf-e), var(--surf-f));
  color: var(--avatar-ink);
  font-weight: 700;
  overflow: hidden;
  flex: 0 0 auto;
  border: 1px solid var(--line-strong);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-sm { width: 32px; height: 32px; font-size: 13px; }
.avatar-empty { background: var(--fill-2); animation: avatarPulse 1.2s ease-in-out infinite alternate; }
@keyframes avatarPulse { from { opacity: .45; } to { opacity: .85; } }
.avatar-lg { width: 104px; height: 104px; font-size: 34px; }

.side-status { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--muted); padding: 0 6px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: 0 0 auto; }
.dot.ok { background: var(--ok); box-shadow: 0 0 8px rgba(63, 185, 80, .7); }
.dot.warn { background: var(--warn); box-shadow: 0 0 8px rgba(210, 153, 34, .7); }
.dot.bad { background: var(--bad); box-shadow: 0 0 8px rgba(255, 107, 107, .7); }
.dot.live { background: var(--accent-2); animation: pulse 1.4s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .45; transform: scale(.8); } }

/* ------------------------------------------------------------ main */
.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }

.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 26px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-glass);
  backdrop-filter: blur(10px);
  flex: 0 0 auto;
}
.page-head { min-width: 0; flex: 1; }
.page-head h1 { margin: 0; font-size: 20px; letter-spacing: -.2px; }
.page-head p { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); }
.top-actions { display: flex; align-items: center; gap: 10px; }

.searchbox {
  display: flex; align-items: center; gap: 8px;
  padding: 0 12px;
  height: 38px;
  width: 240px;
  border-radius: 10px;
  background: var(--fill-1);
  border: 1px solid var(--line);
  color: var(--muted);
}
.searchbox:focus-within { border-color: rgba(196, 73, 95, 0.396); box-shadow: 0 0 0 3px rgba(196, 73, 95, 0.086); }
.searchbox input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font: inherit; }
.search-ico { font-size: 15px; }

.icon-btn {
  position: relative;
  display: inline-grid; place-items: center;
  width: 38px; height: 38px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--fill-1);
  color: var(--text);
  font-size: 15px;
  cursor: pointer;
}
.icon-btn:hover { border-color: rgba(196, 73, 95, 0.36); background: rgba(196, 73, 95, 0.101); }
.badge {
  position: absolute; top: -4px; right: -4px;
  min-width: 16px; height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--accent-2);
  color: #fff;
  font-size: 10px; font-weight: 700;
  display: grid; place-items: center;
}
.only-narrow { display: none; }

.view { flex: 1; min-height: 0; overflow-y: auto; padding: 22px 26px 40px; }
.view > * + * { margin-top: 18px; }

/* ---------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 38px;
  padding: 0 15px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: var(--fill-1);
  color: var(--text);
  font: inherit; font-weight: 600; font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  transition: transform .12s, background .16s, border-color .16s, opacity .16s;
}
.btn:hover { background: var(--fill-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary {
  background: linear-gradient(180deg, var(--btn-from), var(--btn-to));
  border-color: var(--line-strong);
  color: #fff;
  box-shadow: 0 2px 6px var(--shadow-c), inset 0 1px 0 var(--line-strong);
}
.btn-primary:hover { background: linear-gradient(180deg, var(--btn-from-h), var(--btn-to-h)); }
.btn-ghost { background: transparent; }
.btn-danger { border-color: rgba(255, 107, 107, .45); color: var(--bad-text); background: rgba(255, 107, 107, .08); }
.btn-sm { height: 30px; padding: 0 11px; font-size: 12px; border-radius: 8px; }
.input::placeholder, .textarea::placeholder, input::placeholder { color: var(--placeholder); opacity: 1; }
.tag-input input::placeholder { color: var(--placeholder); opacity: 1; }
.btn-strong { background: var(--fill-1); border-color: var(--line-strong); color: var(--text); font-weight: 600; }
.btn-strong:hover { background: var(--fill-2); border-color: var(--line-strong); }
.btn-block { width: 100%; }
.link-btn { background: none; border: 0; color: var(--accent-2); cursor: pointer; font: inherit; padding: 0; }

/* ----------------------------------------------------------- cards */
.panel {
  background: linear-gradient(160deg, var(--surf-c), var(--surf-d));
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px 20px;
  box-shadow: var(--shadow);
}
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.panel-head h2 { margin: 0; font-size: 15px; }
.panel-head p { margin: 3px 0 0; font-size: 12px; color: var(--muted); }
.panel-grid { display: grid; gap: 18px; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* hero */
.hero-card {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 24px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--surf-c), var(--surf-d));
  box-shadow: var(--shadow);
}
.hero-card::after {
  content: "";
  position: absolute; right: -60px; top: -80px;
  width: 260px; height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(196, 73, 95, .10), transparent 70%);
  pointer-events: none;
}
.hero-info { flex: 1; min-width: 0; z-index: 1; }
.hero-info h2 { margin: 0 0 6px; font-size: 22px; letter-spacing: -.3px; }
.hero-info p { margin: 0 0 16px; color: var(--muted); font-size: 13px; max-width: 62ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 11.5px; font-weight: 600;
  background: var(--fill-2);
  border: 1px solid var(--line-strong);
  margin-bottom: 12px;
}

/* stat tiles */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(158px, 1fr)); gap: 14px; }
.stat {
  padding: 16px;
  border-radius: 14px;
  background: linear-gradient(160deg, var(--surf-c), var(--surf-d));
  border: 1px solid var(--line);
}
.stat span.label { display: block; font-size: 11.5px; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; }
.stat strong { display: block; margin-top: 8px; font-size: 26px; letter-spacing: -.6px; }
.stat small { color: var(--muted); font-size: 11.5px; }

/* ------------------------------------------------------- deal cards */
.deal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(238px, 1fr)); gap: 16px; }
.deal {
  display: flex; flex-direction: column;
  border-radius: 14px;
  overflow: hidden;
  background: linear-gradient(180deg, var(--surf-a), var(--surf-b));
  border: 1px solid var(--line);
  transition: transform .16s, border-color .16s, box-shadow .16s;
}
.deal:hover { transform: translateY(-2px); border-color: rgba(196, 73, 95, 0.324); box-shadow: 0 14px 28px var(--shadow-c); }
.deal-thumb { position: relative; aspect-ratio: 4 / 3; background: #fff; overflow: hidden; }
.deal-thumb img { width: 100%; height: 100%; object-fit: contain; }
.deal-discount {
  position: absolute; top: 10px; left: 10px;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(14, 16, 20, .90);
  color: #ffd3dc;
  border: 1px solid rgba(196, 73, 95, .55);
  font-size: 12px; font-weight: 700;
  backdrop-filter: blur(4px);
  box-shadow: none;
}
.deal-body { display: flex; flex-direction: column; gap: 8px; padding: 12px 13px 13px; flex: 1; }
.deal-title {
  font-size: 12.8px; line-height: 1.4;
  color: var(--text);
  text-decoration: none;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  min-height: 36px;
}
.deal-title:hover { color: var(--accent-3); }
.price-row { display: flex; align-items: baseline; gap: 8px; }
.price { font-size: 17px; font-weight: 800; color: var(--text); }
.list-price { font-size: 12px; color: var(--muted); text-decoration: line-through; }
.deal-meta { display: flex; flex-wrap: wrap; gap: 6px; font-size: 11px; color: var(--muted); }
.chip {
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--fill-2);
  border: 1px solid var(--line-strong);
  color: var(--text-dim);
  font-size: 10.8px;
}
.chip.accent { color: var(--accent-text); border-color: rgba(196, 73, 95, .36); background: rgba(196, 73, 95, .14); }
.chip.ok { color: var(--ok-text); border-color: rgba(63, 185, 80, .35); background: rgba(63, 185, 80, .12); }
.chip.warn { color: var(--warn-text); border-color: rgba(210, 153, 34, .35); background: rgba(210, 153, 34, .12); }
.deal-actions { display: flex; gap: 6px; margin-top: auto; padding-top: 4px; }
.deal-actions .btn { flex: 1; }

/* --------------------------------------------------------- forms/UI */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .field-label { font-size: 12px; font-weight: 600; color: var(--text-dim); letter-spacing: .02em; }
.field small.hint { font-size: 11.5px; color: var(--muted); }
.input, .select, .textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: rgba(18, 20, 26, .92);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  outline: 0;
}
.input:focus, .select:focus, .textarea:focus { border-color: rgba(196, 73, 95, 0.432); box-shadow: 0 0 0 3px rgba(196, 73, 95, 0.086); }
.textarea { resize: vertical; min-height: 84px; line-height: 1.55; }
.input-group { display: flex; gap: 8px; }
.input-group .input { flex: 1; }

.switch { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 13px; }
.switch input { display: none; }
.switch .track {
  width: 42px; height: 24px;
  border-radius: 999px;
  background: var(--fill-2);
  border: 1px solid var(--line-strong);
  position: relative;
  transition: background .18s;
  flex: 0 0 auto;
}
.switch .track::after {
  content: "";
  position: absolute; top: 2px; left: 2px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform .18s;
}
.switch input:checked + .track { background: var(--accent); border-color: rgba(255, 77, 106, .6); }
.switch input:checked + .track::after { transform: translateX(18px); }

.segmented { display: inline-flex; padding: 3px; gap: 3px; border-radius: 10px; background: var(--fill-1); border: 1px solid var(--line); }
.segmented button {
  padding: 7px 13px;
  border: 0; border-radius: 8px;
  background: transparent; color: var(--muted);
  font: inherit; font-size: 12.5px; font-weight: 600;
  cursor: pointer;
}
.segmented button.active { background: var(--fill-2); color: var(--text); box-shadow: inset 0 1px 0 var(--line); }

.tag-input {
  display: flex; flex-wrap: wrap; gap: 7px;
  padding: 8px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: rgba(18, 20, 26, .92);
  min-height: 44px;
  align-items: center;
}
.tag-input:focus-within { border-color: var(--line-strong); box-shadow: 0 0 0 3px var(--line); }
.tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(196, 73, 95, 0.13);
  border: 1px solid rgba(196, 73, 95, 0.274);
  font-size: 12px;
  color: var(--accent-text);
}
.tag button { border: 0; background: none; color: inherit; cursor: pointer; font-size: 13px; line-height: 1; opacity: .75; }
.tag button:hover { opacity: 1; }
.tag-input input { flex: 1; min-width: 90px; border: 0; outline: 0; background: transparent; color: var(--text); font: inherit; font-size: 12.5px; }

.row-list { display: flex; flex-direction: column; gap: 10px; }
.row-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 13px;
  border-radius: 12px;
  background: var(--fill-1);
  border: 1px solid var(--line);
}
.row-item .grow { flex: 1; min-width: 0; }
.row-item .name { font-size: 13px; font-weight: 600; }
.row-item .sub { font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.kv { display: grid; grid-template-columns: 150px 1fr; gap: 10px 16px; font-size: 13px; align-items: center; }
.kv dt { color: var(--muted); font-size: 12px; }
.kv dd { margin: 0; }

table.table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.table th {
  text-align: left; padding: 8px 10px;
  font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); border-bottom: 1px solid var(--line);
}
table.table td { padding: 9px 10px; border-bottom: 1px solid var(--line); }
table.table tr:last-child td { border-bottom: 0; }
table.table td.num { font-variant-numeric: tabular-nums; }

.empty-state {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 44px 20px;
  border: 1px dashed var(--line-strong);
  border-radius: 16px;
  color: var(--muted);
  text-align: center;
}
.empty-state strong { color: var(--text); font-size: 14px; }

/* --------------------------------------------------------- drawer */
.drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 392px;
  max-width: 92vw;
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, var(--drawer-a), var(--drawer-b));
  border-left: 1px solid var(--line);
  box-shadow: -24px 0 48px var(--shadow-c);
  transform: translateX(103%);
  transition: transform .26s cubic-bezier(.4, .0, .2, 1);
  z-index: 120;
}
.app.drawer-open .drawer { transform: translateX(0); }
.drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--line);
}
.drawer-head h2 { margin: 0; font-size: 15px; }
.drawer-head p { margin: 3px 0 0; font-size: 11.5px; color: var(--muted); }
.drawer-body { padding: 14px 16px 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.drawer-title { margin: 6px 0 0; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.run-banner {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--fill-1);
  border: 1px solid var(--line);
  font-size: 12.5px;
}
.run-banner #runText { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.event-log {
  margin: 0;
  padding: 12px;
  height: 262px;
  overflow: auto;
  border-radius: 12px;
  background: var(--sunken);
  border: 1px solid var(--line);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11.4px;
  line-height: 1.6;
  color: var(--text-dim);
  white-space: pre-wrap;
  word-break: break-word;
}
.run-history { display: flex; flex-direction: column; gap: 8px; }
.run-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 11px;
  border-radius: 10px;
  background: var(--fill-1);
  border: 1px solid var(--line);
  font-size: 12px;
}
.run-row .when { color: var(--muted); font-size: 11px; }
.scrim {
  position: fixed; inset: 0;
  background: var(--scrim);
  opacity: 0; pointer-events: none;
  transition: opacity .22s;
  z-index: 110;
}
.app.drawer-open .scrim { opacity: 1; pointer-events: auto; }

/* --------------------------------------------------------- profile */
.profile-head { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.avatar-wrap { position: relative; }
.avatar-wrap .avatar-lg { cursor: pointer; }
.avatar-edit {
  position: absolute; right: -2px; bottom: -2px;
  width: 32px; height: 32px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent);
  color: #fff; font-size: 14px;
  border: 2px solid var(--panel);
  cursor: pointer;
}
.dropzone {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 22px;
  border-radius: 14px;
  border: 1px dashed rgba(196, 73, 95, 0.324);
  background: rgba(196, 73, 95, 0.043);
  text-align: center;
  cursor: pointer;
  font-size: 12.5px;
  color: var(--muted);
}
.dropzone.hover { background: rgba(196, 73, 95, 0.115); border-color: var(--accent-2); }
.dropzone strong { font-size: 13px; }

/* --------------------------------------------------------- toasts */
.toast-wrap { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 10px; z-index: 200; }
.toast {
  min-width: 240px; max-width: 360px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  font-size: 13px;
  animation: toast-in .22s ease-out;
}
.toast.ok { border-color: rgba(63, 185, 80, .5); }
.toast.err { border-color: rgba(255, 107, 107, .55); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* category editor rows */
.cat-row { flex-wrap: wrap; }
.cat-fields { display: grid; grid-template-columns: 1fr 1.4fr .9fr; gap: 8px; flex: 1 1 100%; min-width: 0; }
@media (max-width: 720px) { .cat-fields { grid-template-columns: 1fr; } }

/* amazon category picker */
.picker { margin-top: 12px; padding: 12px; border-radius: 12px; background: var(--sunken); border: 1px solid var(--line); }
.picker-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(228px, 1fr)); gap: 7px; max-height: 300px; overflow-y: auto; padding-right: 4px; }
.pick {
  display: flex; align-items: center; gap: 7px;
  padding: 6px 9px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--fill-1);
  font-size: 12.4px;
}
.pick:hover { border-color: rgba(196, 73, 95, 0.324); }
.pick-main { display: flex; align-items: center; gap: 7px; flex: 1; min-width: 0; cursor: pointer; }
.pick-main span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-main input { accent-color: var(--accent); }
.pick-drill {
  border: 0; background: var(--fill-2); color: var(--text);
  width: 20px; height: 20px; border-radius: 6px; cursor: pointer; font-size: 13px; line-height: 1;
  flex: 0 0 auto;
}
.pick-drill:hover { background: rgba(196, 73, 95, 0.288); }

.muted { color: var(--muted); }
.small { font-size: 12px; }
.mt-0 { margin-top: 0; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.inline { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.grid-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.span-2 { grid-column: span 2; }

/* ------------------------------------------------------ responsive */
@media (max-width: 1180px) {
  .searchbox { width: 180px; }
  .cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 960px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0;
    width: 258px;
    transform: translateX(-102%);
    transition: transform .24s;
    z-index: 130;
  }
  .app.nav-open .sidebar { transform: translateX(0); }
  .app.nav-open .scrim { opacity: 1; pointer-events: auto; }
  .only-narrow { display: inline-grid; }
  .searchbox { display: none; }
  .cols-2, .cols-3, .grid-form { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .view { padding: 16px 16px 34px; }
  .topbar { padding: 12px 16px; gap: 10px; }
  .page-head h1 { font-size: 17px; }
  .page-head p { display: none; }
}
@media (max-width: 620px) {
  .top-actions .btn-primary { padding: 0 11px; }
  .kv { grid-template-columns: 1fr; gap: 4px; }
}


/* ---------------------------------------------------- hot daily deals */
/* The hot strip is the app's front door: today's flash deals on amazon.eg,
   ranked by time left, so the countdown gets the loudest colour on the page. */
.hot-panel { position: relative; overflow: hidden; }
.hot-panel::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(720px 150px at 10% -40%, rgba(255, 90, 60, .16), transparent 70%);
  pointer-events: none;
}
.hot-panel > * { position: relative; }
.hot-dot {
  display: inline-block;
  width: 8px; height: 8px; margin-right: 8px;
  border-radius: 50%;
  background: #ff5a3c;
  box-shadow: 0 0 0 0 rgba(255, 90, 60, .55);
  animation: hotPulse 1.9s infinite;
  vertical-align: middle;
}
@keyframes hotPulse {
  70% { box-shadow: 0 0 0 9px rgba(255, 90, 60, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 90, 60, 0); }
}
.hot-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.chip.live { color: var(--accent-text); border-color: rgba(255, 90, 60, .4); background: rgba(255, 90, 60, .14); font-weight: 600; }
.deal-grid-hot { grid-template-columns: repeat(auto-fill, minmax(206px, 1fr)); }
.chip.ends { font-variant-numeric: tabular-nums; white-space: nowrap; }
.chip.ends.hot-now {
  color: #fff;
  background: linear-gradient(135deg, rgba(255, 70, 45, .95), rgba(206, 30, 62, .95));
  border-color: rgba(255, 90, 60, .6);
  font-weight: 700;
}
.chip.ends.hot-soon { color: var(--warn-text); border-color: rgba(240, 150, 40, .45); background: rgba(240, 150, 40, .14); }
.chip.ends.hot-later { color: var(--ok-text); border-color: rgba(63, 185, 80, .32); background: rgba(63, 185, 80, .12); }
.chip.ends.ended { color: var(--muted); text-decoration: line-through; }
.deal-ribbon {
  position: absolute; top: 10px; right: 10px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255, 70, 45, .95);
  color: #fff;
  font-size: 10.5px; font-weight: 700; letter-spacing: .02em;
  box-shadow: 0 3px 10px rgba(0, 0, 0, .28);
}
.lock-field {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 12px; border-radius: 10px;
  background: var(--fill-2); border: 1px dashed var(--line-strong);
}
.lock-field code { font-size: 11.5px; color: var(--muted); }
