/* ===============================================
   style.css — The Toolshed Inventory
   v16 — Design refresh: warm palette, filter bar
         below header, image scale hover, modal
         animations, two-column view, muted badges
   =============================================== */

@import url("https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@600;700&family=Barlow:wght@400;500;600&display=swap");

/* -----------------------------------------------
   RESET & BASE
----------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #f2ebdd;
  --header: #1c2333;
  --accent: #d4500a;
  --card: #ffffff;
  --text: #1a1a1a;
  --muted: #6b7280;
  --border: #ddd9d3;
  --green: #2d6a2d;
  --red: #8b2222;
  --gray: #9ca3af;
  --radius: 10px;
  --filter-radius: 20px;
  --btn-radius: 8px;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

html {
  scroll-behavior: smooth;
}
html,
body {
  width: 100%;
  overflow-x: hidden;
}

body {
  font-family: "Barlow", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 17px;
  line-height: 1.6;
  min-height: 100vh;
}

/* -----------------------------------------------
   FIXED TOP BAR — header + search only
   (filter bar is now below, not fixed)
----------------------------------------------- */
.top-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  background: var(--header);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

.site-header {
  padding: 0 16px;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.site-logo {
  font-family: "Barlow Condensed", sans-serif;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: white;
  text-decoration: none;
}
.site-logo span {
  color: var(--accent);
}
.site-logo:hover {
  opacity: 0.9;
}

.btn-add {
  background: var(--accent);
  color: white;
  border: none;
  padding: 9px 16px;
  border-radius: var(--btn-radius);
  font-family: "Barlow", sans-serif;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.15s;
  white-space: nowrap;
  box-shadow: inset 0 -2px 0 rgba(0,0,0,0.18);
}
.btn-add:hover {
  background: #b84208;
}

/* -----------------------------------------------
   SEARCH BAR (inside fixed top-bar)
----------------------------------------------- */
.search-bar {
  padding: 0 16px 10px;
  width: 100%;
}

.search-form {
  display: flex;
  gap: 8px;
  align-items: center;
  max-width: 620px;
  margin: 0 auto;
}

/* Input + mic joined together with no gap */
.search-joined-group {
  display: flex;
  flex: 1;
  align-items: center;
  min-width: 0;
}

.search-input-wrap {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  min-width: 0;
}

.search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: #9ca3af;
  pointer-events: none;
  z-index: 1;
}

.search-input {
  width: 100%;
  padding: 10px 36px 10px 34px;
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  border-radius: var(--btn-radius) 0 0 var(--btn-radius);
  font-family: "Barlow", sans-serif;
  font-size: 16px;
  color: var(--text);
  background: #ffffff;
  outline: none;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}
.search-input::placeholder {
  color: #9ca3af;
}
.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(212, 80, 10, 0.15);
}

.search-clear {
  position: absolute;
  right: 10px;
  color: var(--muted);
  text-decoration: none;
  font-size: 15px;
  line-height: 1;
  transition: color 0.15s;
}
.search-clear:hover {
  color: var(--text);
}

.search-btn {
  background: var(--accent);
  color: white;
  border: none;
  padding: 10px 16px;
  border-radius: var(--btn-radius);
  font-family: "Barlow", sans-serif;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
  flex-shrink: 0;
  height: 42px;
  display: flex;
  align-items: center;
}
.search-btn:hover {
  background: #b84208;
}

/* -----------------------------------------------
   FILTER BAR — below header, not fixed, wraps
----------------------------------------------- */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 0 20px 0;
  width: 100%;
}

.filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 15px;
  border-radius: var(--filter-radius);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  color: var(--text);
  border: 1.5px solid var(--border);
  background: transparent;
  transition: all 0.15s;
  white-space: nowrap;
  cursor: pointer;
}
.filter-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: transparent;
}
.filter-btn.active {
  background: var(--header);
  color: white;
  border-color: var(--header);
}
.filter-btn.active:hover {
  background: var(--accent);
  border-color: var(--accent);
}

.filter-count {
  font-size: 11px;
  font-weight: 600;
  opacity: 0.6;
}
.filter-btn.active .filter-count {
  opacity: 0.75;
}

/* -----------------------------------------------
   MAIN CONTENT
----------------------------------------------- */
.main-content {
  width: 100%;
  max-width: 1000px;
  margin-left: auto;
  margin-right: auto;
  padding: 18px 16px 80px;
  /* padding-top set by JS */
}

/* -----------------------------------------------
   PAGINATION BAR
----------------------------------------------- */
.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 10px;
  flex-wrap: wrap;
}

.pagination-bottom {
  margin-top: 28px;
  margin-bottom: 0;
}

/* Range label — ALL CAPS, tracked, dark */
.range-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.pagination-nav {
  display: flex;
  gap: 8px;
}

.page-btn {
  display: inline-flex;
  align-items: center;
  padding: 8px 18px;
  background: var(--header);
  color: white;
  border-radius: var(--filter-radius);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: background 0.15s;
  white-space: nowrap;
}
.page-btn:hover {
  background: var(--accent);
}

/* -----------------------------------------------
   TOOL GRID
----------------------------------------------- */
.tools-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  width: 100%;
}

/** MOBILE CHANGES **/
@media (min-width: 540px) {
  .tools-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/** MOBILE CHANGES **/
@media (min-width: 800px) {
  .tools-grid {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

/* -----------------------------------------------
   TOOL CARD
----------------------------------------------- */
.tool-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  width: 100%;
}

/* Image link — position context for badge */
.tool-card-img-link {
  display: block;
  text-decoration: none;
  width: 100%;
  position: relative;
  overflow: hidden; /* clips scaled image at card edge */
  border-radius: var(--radius) var(--radius) 0 0;
}

.tool-card-img {
  width: 100%;
  background: #e5e2dc;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 14px;
  overflow: hidden;
  position: relative;
}

/* Image scales on hover — smooth ease */
.tool-card-img img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.4s ease;
  transform-origin: center center;
}
.tool-card:hover .tool-card-img img {
  transform: scale(1.05);
}
.tool-card:hover {
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.16);
}

.tool-card-img .no-photo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  padding: 44px 0;
}

/* Index badge — overlaid top-right, on img-link not inside img */
.index-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(255, 255, 255, 0.52);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  color: #1a1a1a;
  font-family: "Barlow Condensed", sans-serif;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 3px 9px;
  border-radius: 20px;
  line-height: 1.3;
  pointer-events: none;
  border: 1px solid rgba(255, 255, 255, 0.4);
  z-index: 2;
}

/* Card body */
.tool-card-body {
  padding: 12px 14px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tool-name-link {
  text-decoration: none;
}

.tool-name {
  font-family: "Barlow Condensed", sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
  transition: color 0.15s;
}
.tool-name-link:hover .tool-name {
  color: var(--accent);
}

.tool-label {
  font-size: 14px;
  color: var(--muted);
  font-weight: 500;
}

.tool-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}

/* Muted warm badge palette */
.badge {
  font-size: 13px;
  font-weight: 100;
  padding: 3px 10px;
  border-radius: var(--filter-radius);
  display: inline-block;
}
.badge-cat-a {
  background: #f4dcd2;
  color: #a52911;
}
.badge-cat-b {
  background: #e5e4c9;
  color: #5e6033;
}
.badge-y {
  background: #d6ead6;
  color: var(--green);
}
.badge-n {
  background: #ead6d6;
  color: var(--red);
}
.badge-na {
  background: #e8e4dc;
  color: #6b6055;
}

.tool-location {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 15px;
  font-weight: 600;
  color: #374151;
}

/* Card footer — icon buttons */
.tool-card-footer {
  display: flex;
  border-top: 1px solid var(--border);
  width: 100%;
}

/* On mobile the footer is hidden — revealed by swipe */
@media (max-width: 767px) {
  .tool-card-footer {
    display: none;
  }
  .tool-card.swipe-open .tool-card-footer {
    display: flex;
  }
}

.btn-icon {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 10px;
  text-decoration: none;
  transition: background 0.15s;
  border-left: 1px solid var(--border);
  position: relative;
}
.btn-icon:first-child {
  border-left: none;
}

.btn-icon-view {
  color: var(--accent);
}
.btn-icon-view:hover {
  background: #fff5f0;
}
.btn-icon-edit {
  color: #2563eb;
}
.btn-icon-edit:hover {
  background: #eff6ff;
}
.btn-icon-delete {
  color: var(--red);
}
.btn-icon-delete:hover {
  background: #fff4f4;
}

/* -----------------------------------------------
   TOOLTIP SYSTEM
----------------------------------------------- */
[data-tooltip] {
  position: relative;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #1a1a1a;
  color: white;
  font-size: 12px;
  font-weight: 600;
  font-family: "Barlow", sans-serif;
  padding: 5px 10px;
  border-radius: var(--btn-radius);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 300;
}

[data-tooltip]::before {
  content: "";
  position: absolute;
  bottom: calc(100% + 3px);
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: #1a1a1a;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 300;
}

[data-tooltip]:hover::after,
[data-tooltip]:hover::before {
  opacity: 1;
}

/* Pin icon tooltip drops DOWN */
.btn-icon-pin::after {
  bottom: auto;
  top: calc(100% + 8px);
}
.btn-icon-pin::before {
  bottom: auto;
  top: calc(100% + 3px);
  border-top-color: transparent;
  border-bottom-color: #1a1a1a;
}

/* -----------------------------------------------
   BREADCRUMB / BACK LINKS — ALL CAPS, tracked
----------------------------------------------- */
.form-back,
.vp-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text);
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 20px;
  transition: color 0.15s;
}
.form-back:hover,
.vp-back:hover {
  color: var(--accent);
}

/* -----------------------------------------------
   EMPTY STATE
----------------------------------------------- */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
  font-size: 17px;
}
.empty-state p {
  font-size: 16px;
  margin-top: 10px;
}

/* -----------------------------------------------
   BACK TO TOP BUTTON
----------------------------------------------- */
.back-to-top {
  position: fixed;
  bottom: 110px;
  right: 20px;
  width: 48px;
  height: 48px;
  background: var(--header);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4), 0 1px 4px rgba(0,0,0,0.2);
  opacity: 0;
  transform: translateY(16px);
  transition:
    opacity 0.25s,
    transform 0.25s,
    background 0.15s;
  pointer-events: none;
  z-index: 150;
}
.back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.back-to-top:hover {
  background: var(--accent);
}

/* -----------------------------------------------
   FORM PAGES — add.php / edit.php
----------------------------------------------- */
.form-page {
  width: 100%;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  padding: 20px 16px 320px;
}

.form-title {
  font-family: "Barlow Condensed", sans-serif;
  font-size: 30px;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.form-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

.form-group label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.form-group input,
.form-group select {
  padding: 11px 13px;
  border: 1.5px solid var(--border);
  border-radius: var(--btn-radius);
  font-family: "Barlow", sans-serif;
  font-size: 17px;
  color: var(--text);
  background: white;
  width: 100%;
  transition: border-color 0.15s;
  -webkit-appearance: none;
}
.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--accent);
}

/* Photo upload — two-button UI */
.photo-upload-wrap {
  width: 100%;
}
.photo-btn-row {
  display: flex;
  gap: 10px;
}
.photo-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 10px;
  border: none;
  border-radius: var(--btn-radius);
  background: var(--accent);
  color: #fff;
  font-family: 'Barlow', sans-serif;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.photo-btn:hover  { background: #a33d08; }
.photo-btn:active { background: #822f06; }
.photo-btn-secondary {
  background: transparent;
  border: 1.5px solid var(--accent);
  color: var(--accent);
}
.photo-btn-secondary:hover  { background: #fff5f0; }
.photo-btn-secondary:active { background: #ffe8dc; }
.form-group input[type="number"]::-webkit-inner-spin-button,
.form-group input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.form-group input[type="number"] {
  -moz-appearance: textfield;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  width: 100%;
}

/** MOBILE CHANGES **/
@media (max-width: 400px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

.ql-container {
  font-family: "Barlow", sans-serif !important;
  font-size: 17px !important;
}
.ql-toolbar {
  border-radius: 8px 8px 0 0 !important;
  border-color: var(--border) !important;
}
.ql-container.ql-snow {
  border-radius: 0 0 8px 8px !important;
  border-color: var(--border) !important;
  min-height: 130px;
}

.img-upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--btn-radius);
  padding: 22px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s;
  background: #faf9f7;
  width: 100%;
}
.img-upload-area:hover {
  border-color: var(--accent);
}
.img-upload-area input[type="file"] {
  display: none;
}
.img-upload-area p {
  font-size: 15px;
  color: var(--muted);
  margin-top: 8px;
}

.img-preview {
  width: 100%;
  height: auto;
  border-radius: var(--btn-radius);
  margin-top: 10px;
  display: none;
}

.btn-submit {
  background: var(--accent);
  color: white;
  border: none;
  padding: 15px;
  border-radius: var(--btn-radius);
  font-family: "Barlow", sans-serif;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  margin-top: 4px;
  transition: background 0.15s;
  letter-spacing: 0.02em;
}
.btn-submit:hover {
  background: #b84208;
}

/* -----------------------------------------------
   FLASH MESSAGES
----------------------------------------------- */
.flash {
  padding: 14px 16px;
  border-radius: var(--btn-radius);
  font-size: 15px;
  font-weight: 500;
  margin-bottom: 16px;
  width: 100%;
}
.flash-success {
  background: #d6ead6;
  color: var(--green);
  border: 1px solid #9ecf9e;
}
.flash-error {
  background: #ead6d6;
  color: var(--red);
  border: 1px solid #cf9e9e;
}

/* -----------------------------------------------
   DELETE CONFIRM PAGE
----------------------------------------------- */
.confirm-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 30px 20px;
  border: 1px solid var(--border);
  text-align: center;
  width: 100%;
}
.confirm-card h2 {
  font-family: "Barlow Condensed", sans-serif;
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 12px;
}
.confirm-card p {
  color: var(--muted);
  margin-bottom: 26px;
  font-size: 16px;
}

.btn-row {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.btn-cancel {
  padding: 13px 26px;
  border-radius: var(--btn-radius);
  border: 1.5px solid var(--border);
  background: white;
  font-family: "Barlow", sans-serif;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  color: var(--text);
  transition: background 0.15s;
}
.btn-cancel:hover {
  background: var(--bg);
}

.btn-danger {
  padding: 13px 26px;
  border-radius: var(--btn-radius);
  border: none;
  background: var(--red);
  color: white;
  font-family: "Barlow", sans-serif;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-danger:hover {
  background: #6b1a1a;
}

/* -----------------------------------------------
   PIN ICON NAV BUTTON
----------------------------------------------- */
.btn-icon-pin {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--btn-radius);
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  transition:
    border-color 0.15s,
    background 0.15s;
}
.btn-icon-pin:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.5);
}

/* -----------------------------------------------
   LOCATION THUMBNAIL & TOOLTIP
----------------------------------------------- */
.loc-thumb-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  position: relative;
}
.loc-thumb {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  object-fit: cover;
  border: 1.5px solid var(--border);
  flex-shrink: 0;
  transition: border-color 0.15s;
}
.loc-thumb-wrap:hover .loc-thumb {
  border-color: var(--accent);
}
.loc-thumb-tap-hint {
  font-size: 11px;
  color: var(--muted);
  display: block;
  margin-top: 1px;
}

/* Hover tooltip — subtle slide from left */
@keyframes tooltipIn {
  from {
    opacity: 0;
    transform: translateX(calc(-50% - 20px));
  }
  to {
    opacity: 1;
    transform: translateX(-50%);
  }
}

.loc-tooltip {
  display: none;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 88%;
  transform: translateX(-50%);
  z-index: 100;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--btn-radius);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  padding: 8px;
  width: 200px;
  pointer-events: none;
}
.loc-tooltip img {
  width: 100%;
  border-radius: 4px;
  display: block;
  margin-bottom: 6px;
}
.loc-tooltip-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}
.loc-tooltip-desc {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

@media (hover: hover) {
  .loc-thumb-wrap:hover .loc-tooltip {
    display: block;
    animation: tooltipIn 0.22s ease-out forwards;
  }
}

/* -----------------------------------------------
   LOCATION MODAL — fade + slide from left
----------------------------------------------- */
@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.loc-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 500;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.loc-modal-overlay.active {
  display: flex;
}

.loc-modal {
  background: var(--card);
  border-radius: 12px;
  max-width: 400px;
  width: 100%;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
  animation: modalSlideIn 0.25s ease-out forwards;
}
.loc-modal img {
  width: 100%;
  display: block;
}
.loc-modal-body {
  padding: 16px;
}
.loc-modal-label {
  font-family: "Barlow Condensed", sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
}
.loc-modal-desc {
  font-size: 14px;
  color: var(--muted);
  margin-top: 4px;
}
.loc-modal-close {
  display: block;
  width: 100%;
  margin-top: 14px;
  padding: 12px;
  background: var(--header);
  color: white;
  border: none;
  border-radius: var(--btn-radius);
  font-family: "Barlow", sans-serif;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.loc-modal-close:hover {
  background: var(--accent);
}

/* -----------------------------------------------
   VIEW PAGE — two-column layout
----------------------------------------------- */
.vp-wrap {
  box-sizing: border-box;
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 20px 16px 60px;
}
.vp-wrap * {
  box-sizing: border-box;
}

/* Two-column on desktop */
.vp-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  margin-bottom: 20px;
}

@media (min-width: 768px) {
  .vp-layout {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
}

/* Left column — image */
.vp-left {
  width: 100%;
}

.vp-photo {
  width: 100%;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  position: relative;
}
.vp-photo img {
  width: 100%;
  height: auto;
  display: block;
}
.vp-no-photo {
  width: 100%;
  background: #e5e2dc;
  border-radius: var(--radius);
  padding: 50px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 15px;
  border: 1px solid var(--border);
}

/* Index badge on view photo */
.vp-photo .index-badge {
  z-index: 2;
}

/* Right column — info block with slide-in animation */
@keyframes infoSlideIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.vp-right {
  width: 100%;
  animation: infoSlideIn 0.35s ease-out forwards;
}

.vp-meta-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.vp-name {
  font-family: "Barlow Condensed", sans-serif;
  font-size: 36px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.1;
  margin: 0 0 6px 0;
}

.vp-label {
  font-size: 16px;
  color: var(--muted);
  margin-bottom: 12px;
}

.vp-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 18px;
}

.vp-badge {
  font-size: 14px;
  font-weight: 100;
  padding: 4px 12px;
  border-radius: var(--filter-radius);
  display: inline-block;
}

/* Info card */
.vp-card {
  width: 100%;
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: visible;
}

.vp-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}
.vp-row:last-child {
  border-bottom: none;
}

.vp-row-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  flex-shrink: 0;
}

.vp-row-value {
  font-size: 15px;
  color: var(--text);
  text-align: right;
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

/* Notes — accent left border block style */
.vp-notes {
  width: 100%;
  background: #fdf9f5;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 20px;
}

.vp-notes-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: #faf6f0;
}

.vp-notes-body {
  padding: 16px;
  font-size: 16px;
  line-height: 1.75;
  color: var(--text);
}
.vp-notes-body p {
  margin-bottom: 10px;
}
.vp-notes-body p:last-child {
  margin-bottom: 0;
}
.vp-notes-body strong {
  font-weight: 600;
}
.vp-notes-body em {
  font-style: italic;
}
.vp-notes-body ul,
.vp-notes-body ol {
  padding-left: 22px;
  margin-bottom: 10px;
}
.vp-notes-body li {
  margin-bottom: 4px;
}

/* Action buttons — auto width, left aligned, icons, pill shaped */
.vp-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-start;
  flex-wrap: wrap;
}

.vp-btn-edit {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 22px;
  background: var(--accent);
  color: white;
  border-radius: var(--btn-radius);
  text-decoration: none;
  font-size: 16px;
  font-weight: 600;
  transition: background 0.15s;
  white-space: nowrap;
}
.vp-btn-edit:hover {
  background: #b84208;
}

.vp-btn-delete {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 22px;
  background: white;
  color: var(--red);
  border-radius: var(--btn-radius);
  text-decoration: none;
  font-size: 16px;
  font-weight: 600;
  border: 1.5px solid var(--border);
  transition:
    background 0.15s,
    border-color 0.15s;
  white-space: nowrap;
}
.vp-btn-delete:hover {
  background: #fff4f4;
  border-color: #cf9e9e;
}

/* -----------------------------------------------
   CATEGORY CHECKBOXES
----------------------------------------------- */
.form-group-full {
  grid-column: 1 / -1;
}

.label-hint {
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
  text-transform: none;
  letter-spacing: 0;
  margin-left: 6px;
}

.checkbox-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 14px;
  background: #faf9f7;
  border: 1.5px solid var(--border);
  border-radius: var(--btn-radius);
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  padding: 4px 0;
}

.checkbox-item input[type="checkbox"] {
  width: 18px !important;
  height: 18px !important;
  padding: 0 !important;
  border: none !important;
  background: none !important;
  -webkit-appearance: checkbox !important;
  appearance: checkbox !important;
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
}

.checkbox-item:hover span {
  color: var(--accent);
}
/* -----------------------------------------------
   LOCATION CUSTOM SELECT WITH THUMBNAILS
----------------------------------------------- */
.loc-select {
  position: relative;
  width: 100%;
  user-select: none;
}

.loc-select-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 13px;
  border: 1.5px solid var(--border);
  border-radius: var(--btn-radius);
  background: white;
  cursor: pointer;
  transition: border-color 0.15s;
  min-height: 48px;
}
.loc-select.open .loc-select-trigger {
  border-color: var(--border);
  border-radius: 8px 8px 0 0;
}
.loc-select-trigger:hover {
  border-color: var(--accent);
}

.loc-select-thumb {
  width: 48px;
  height: 48px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--border);
}

.loc-select-placeholder-icon {
  width: 48px;
  height: 48px;
  border-radius: 4px;
  background: #f0ede8;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--muted);
}

.loc-select-label {
  flex: 1;
  font-size: 16px;
  color: var(--text);
  font-family: "Barlow", sans-serif;
}

.loc-select-arrow {
  color: var(--muted);
  flex-shrink: 0;
  transition: transform 0.2s;
}
.loc-select.open .loc-select-arrow {
  transform: rotate(180deg);
}

.loc-select-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1.5px solid var(--border);
  border-top: none;
  border-radius: 0 0 8px 8px;
  z-index: 100;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  overflow: hidden;
  flex-direction: column;
}
.loc-select-dropdown.open {
  display: flex;
}

/* Scrollable list panel */
.loc-select-list {
  max-height: 220px;
  overflow-y: auto;
  scrollbar-width: none; /* hide native scrollbar — we use our own */
  flex: 1;
}
.loc-select-list::-webkit-scrollbar { display: none; }

/* Wrapper: list on left, scroll controls on right */
.loc-list-wrapper {
  display: flex;
  flex-direction: row;
}

/* Right scroll control column */
.loc-scroll-ctrl {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 36px;
  flex-shrink: 0;
  background: #ddd8ce;
  border-left: 1px solid #c8c2b8;
  padding: 4px 0;
  gap: 4px;
  order: 2;
}

.loc-scroll-btn {
  width: 28px;
  height: 28px;
  border: none;
  background: var(--accent);
  color: #fff;
  border-radius: 5px;
  cursor: pointer;
  font-size: 10px;
  line-height: 1;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.loc-scroll-btn:hover  { background: #a33d08; }
.loc-scroll-btn:active { background: #822f06; }

.loc-scroll-track {
  flex: 1;
  width: 10px;
  background: #c8c2b8;
  border-radius: 5px;
  position: relative;
  min-height: 40px;
}

.loc-scroll-thumb {
  position: absolute;
  left: 0;
  right: 0;
  background: #8a8480;
  border-radius: 5px;
  min-height: 28px;
  transition: top 0.1s;
  cursor: grab;
}

/* Preview pane — bottom of dropdown */
.loc-select-preview {
  border-top: 2px dashed #9ca3af;
  background: #e8e2d6;
  height: 260px;
  flex-shrink: 0;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.loc-select-preview.visible {
  align-items: stretch;
  justify-content: flex-start;
}

.loc-select-preview.visible {
  opacity: 1;
  pointer-events: auto;
}

.loc-select-preview img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #f5f0e8;
  display: block;
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
}

.loc-select-preview img.loaded {
  opacity: 1;
}

.loc-select-preview-body {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 10px 13px 12px;
  background: rgba(28, 35, 51, 0.62);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.loc-select-preview-label {
  font-size: 18px;
  font-weight: 700;
  color: #ffffff;
}
.loc-select-preview-desc {
  font-size: 15px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.82);
  margin-top: 4px;
}
.loc-select-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 13px;
  cursor: pointer;
  transition: background 0.12s;
  border-bottom: 1px solid var(--border);
}
.loc-select-option:last-child {
  border-bottom: none;
}
.loc-select-option:hover {
  background: #faf6f0;
}
.loc-select-option.selected {
  background: #fff5f0;
}
.loc-select-option.pending {
  background: #fff5f0;
  border-left: 3px solid var(--accent);
}

.loc-select-option-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.loc-select-option-label {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}
.loc-select-option-desc {
  font-size: 12px;
  color: var(--muted);
}
.loc-preview-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 100%;
  color: #1f1e1d;
  font-size: 18px;
  font-weight: 500;
  letter-spacing: 0.03em;
}
.loc-preview-placeholder .hover-text {
  display: inline;
}
.loc-preview-placeholder .tap-text {
  display: none;
}

@media (hover: none) {
  .loc-preview-placeholder .hover-text {
    display: none;
  }
  .loc-preview-placeholder .tap-text {
    display: inline;
  }
}

/* ── Site Footer ─────────────────────────────────────────────── */
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.main-content,
.form-page,
.vp-wrap {
  flex: 1;
}

.site-footer {
  background: #1c2333;
  color: #9ca3af;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 8px;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
}

/* Push page content above the fixed footer */
.main-content,
.form-page,
.vp-wrap {
  padding-bottom: 60px;
}

.site-footer-left {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 1;
  min-width: 0;
}

.footer-mgmt-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  border-radius: var(--btn-radius);
  border: 1px solid rgba(255,255,255,0.12);
  color: #d1d5db;
  font-family: 'Barlow', sans-serif;
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.footer-mgmt-btn:hover {
  background: rgba(255,255,255,0.08);
  color: #fff;
}
.footer-mgmt-btn svg {
  flex-shrink: 0;
  opacity: 0.8;
}

.footer-copyright {
  font-family: 'Barlow', sans-serif;
  font-size: 12px;
  color: #e5e7eb;
  flex-shrink: 0;
  white-space: nowrap;
}

/* Mobile — copyright label only, keep button text */
@media (max-width: 767px) {
  .footer-copyright-label { display: none; }
  .footer-mgmt-btn svg {
    width: 20px;
    height: 20px;
  }
}

/* ── Filters page ────────────────────────────────────────────── */
.filters-intro {
  font-size: 15px;
  color: #6b7280;
  margin-bottom: 20px;
  line-height: 1.6;
}

.filters-add-wrap {
  margin-bottom: 28px;
}
.filters-add-form {
  display: flex;
  gap: 10px;
}
.filters-add-input {
  flex: 1;
  padding: 11px 13px;
  border: 1.5px solid var(--border);
  border-radius: var(--btn-radius);
  font-family: 'Barlow', sans-serif;
  font-size: 16px;
  color: var(--text);
  background: white;
}
.filters-add-input:focus {
  outline: none;
  border-color: var(--accent);
}
.filters-add-btn {
  padding: 11px 18px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--btn-radius);
  font-family: 'Barlow', sans-serif;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}
.filters-add-btn:hover { background: #a33d08; }

.filters-section {
  margin-bottom: 28px;
}
.filters-section-title {
  font-family: 'Barlow Condensed', 'Barlow', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #9ca3af;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.filters-empty {
  font-size: 14px;
  color: #9ca3af;
  padding: 12px 0;
}

.filters-table {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.filters-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--btn-radius);
  padding: 10px 12px;
  transition: box-shadow 0.15s;
}
.filters-row:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.filters-row-hidden {
  background: #f7f5f1;
  opacity: 0.7;
}

.filters-order {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 22px;
  flex-shrink: 0;
}
.filters-arrow {
  background: none;
  border: none;
  cursor: pointer;
  color: #9ca3af;
  font-size: 10px;
  padding: 1px;
  line-height: 1;
  transition: color 0.15s;
}
.filters-arrow:hover:not(:disabled) { color: var(--accent); }
.filters-arrow:disabled { opacity: 0.25; cursor: default; }

.filters-name {
  flex: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
}
.filters-name-text {
  font-family: 'Barlow', sans-serif;
  font-size: 16px;
  font-weight: 500;
  color: var(--text);
}
.filters-name-hint {
  font-size: 12px;
  color: #9ca3af;
  opacity: 0;
  transition: opacity 0.15s;
}
.filters-name:hover .filters-name-hint { opacity: 1; }
.filters-name-muted .filters-name-text { color: #9ca3af; }
.filters-name-muted { cursor: default; }

.filters-rename-input {
  font-family: 'Barlow', sans-serif;
  font-size: 16px;
  font-weight: 500;
  color: var(--text);
  border: 1.5px solid var(--accent);
  border-radius: var(--btn-radius);
  padding: 4px 8px;
  width: 100%;
  outline: none;
}

.filters-count {
  font-size: 13px;
  color: #9ca3af;
  white-space: nowrap;
  min-width: 60px;
  text-align: right;
}

.filters-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.filters-btn-hide,
.filters-btn-show,
.filters-btn-delete {
  padding: 6px 12px;
  border-radius: var(--btn-radius);
  font-family: 'Barlow', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background 0.15s;
}
.filters-btn-hide {
  background: #f3f4f6;
  color: #6b7280;
}
.filters-btn-hide:hover { background: #e5e7eb; }

.filters-btn-show {
  background: #d6ead6;
  color: #2d6a2d;
}
.filters-btn-show:hover { background: #c3dcc3; }

.filters-btn-delete {
  background: #fce8e8;
  color: #8b2222;
}
.filters-btn-delete:hover { background: #f5cece; }

/* Delete confirmation modal */
.filters-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
}
.filters-modal {
  background: white;
  border-radius: 14px;
  padding: 28px 24px;
  width: min(90vw, 380px);
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  text-align: center;
}
.filters-modal-icon {
  margin-bottom: 14px;
}
.filters-modal-title {
  font-family: 'Barlow', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
}
.filters-modal-msg {
  font-size: 15px;
  color: #6b7280;
  line-height: 1.5;
  margin-bottom: 22px;
}
.filters-modal-msg strong {
  color: var(--text);
}
.filters-modal-btns {
  display: flex;
  gap: 10px;
}
.filters-modal-cancel {
  flex: 1;
  padding: 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--btn-radius);
  background: transparent;
  font-family: 'Barlow', sans-serif;
  font-size: 15px;
  cursor: pointer;
  color: #6b7280;
}
.filters-modal-cancel:hover { background: #f3f4f6; }
.filters-modal-confirm {
  flex: 1;
  padding: 12px;
  border: none;
  border-radius: var(--btn-radius);
  background: #8b2222;
  color: #fff;
  font-family: 'Barlow', sans-serif;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
.filters-modal-confirm:hover { background: #6e1a1a; }

@media (max-width: 520px) {
  .filters-row { flex-wrap: wrap; }
  .filters-count { min-width: unset; }
  .site-footer { flex-direction: row; align-items: center; }
  .site-footer-right { align-self: auto; }
}

/* -----------------------------------------------
   FLOATING ACTION BUTTON (FAB)
----------------------------------------------- */
.fab-add {
  position: fixed;
  bottom: 84px;
  right: 18px;
  z-index: 200;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 50px;
  padding: 14px 20px;
  font-family: "Barlow", sans-serif;
  font-size: 17px;
  font-weight: 700;
  text-decoration: none;
  display: none;
  align-items: center;
  gap: 8px;
  box-shadow:
    0 4px 18px rgba(212, 80, 10, 0.45),
    inset 0 -2px 0 rgba(0,0,0,0.18);
  transition: background 0.15s, transform 0.15s;
  cursor: pointer;
  white-space: nowrap;
}
.fab-add:active { transform: scale(0.96); }
.fab-add:hover  { background: #b84208; }

@media (max-width: 767px) {
  .fab-add { display: none !important; }
  .header-btn-add { display: inline-flex !important; }
}
@media (min-width: 768px) {
  .fab-add { display: none !important; }
  .header-btn-add { display: inline-flex !important; }
}

/* Card action row — View Location + View Tool side by side */
.card-action-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: nowrap;
}

.card-action-btn {
  display: flex;
  align-items: center;
}

/* View Tool — mobile only */
.card-action-btn-mobile {
  display: none;
}
@media (max-width: 767px) {
  .card-action-btn-mobile { display: flex; }
}

/* Shared style for both action buttons */
.loc-thumb-wrap,
.tool-view-btn-mobile {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'Barlow', sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: var(--btn-radius);
  border: 1.5px solid var(--border);
  background: white;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}

/* Desktop — remove border on VIEW Location, keep it clean */
@media (min-width: 768px) {
  .loc-thumb-wrap {
    border: none;
    background: transparent;
    padding: 0;
  }
}
.loc-thumb-wrap:hover,
.tool-view-btn-mobile:hover {
  background: var(--bg);
  color: var(--text);
}
.loc-thumb-wrap svg,
.tool-view-btn-mobile svg {
  flex-shrink: 0;
}

/* -----------------------------------------------
   LARGER MOBILE TAP TARGETS
----------------------------------------------- */
@media (max-width: 767px) {
  .filter-btn {
    padding: 10px 18px;
    font-size: 15px;
    min-height: 44px;
  }
  .filter-count { font-size: 13px; }
  .btn-icon {
    padding: 16px 10px;
    min-height: 52px;
  }
  .btn-icon svg {
    width: 22px;
    height: 22px;
  }
  .tool-name  { font-size: 24px; }
  .tool-label { font-size: 15px; }
}

/* -----------------------------------------------
   PAGE FADE-IN
----------------------------------------------- */
@keyframes pageFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.main-content,
.form-page,
.vp-wrap {
  animation: pageFadeIn 0.22s ease-out both;
}

/* -----------------------------------------------
   EMPTY STATE — warm illustrated
----------------------------------------------- */
.empty-state {
  text-align: center;
  padding: 60px 20px 80px;
  color: var(--muted);
  font-size: 17px;
  animation: pageFadeIn 0.3s ease-out both;
}
.empty-state-icon {
  margin-bottom: 18px;
}
.empty-state-title {
  font-family: "Barlow Condensed", sans-serif;
  font-size: 26px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
}
.empty-state p {
  font-size: 16px;
  margin-top: 8px;
  color: var(--muted);
}
.empty-state a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}
.empty-state a:hover { text-decoration: underline; }

/* -----------------------------------------------
   VOICE SEARCH BUTTON
----------------------------------------------- */
.voice-btn {
  background: #b84208;
  border: none;
  cursor: pointer;
  color: white;
  padding: 0 12px;
  border-radius: 0 var(--btn-radius) var(--btn-radius) 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  flex-shrink: 0;
  height: 42px;
  width: 42px;
}
.voice-btn:hover {
  background: #a33d08;
}
.voice-btn.voice-listening {
  background: var(--accent);
  animation: voicePulse 1s ease-in-out infinite;
}
@keyframes voicePulse {
  0%, 100% { transform: scale(1);   opacity: 1; }
  50%       { transform: scale(1.05); opacity: 0.85; }
}

/* Clear button no longer needs offset — voice btn is outside */
.search-input-wrap .search-clear {
  right: 10px;
}

/* -----------------------------------------------
   SWIPE TO REVEAL — proper slide structure
----------------------------------------------- */
/* Hidden action panel — desktop: hidden, mobile: shown on swipe */
.card-swipe-actions {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  display: none; /* hidden on desktop */
  align-items: stretch;
  z-index: 1;
}
.card-action-edit,
.card-action-delete {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 22px;
  font-family: 'Barlow', sans-serif;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  color: white;
}
.card-action-edit   { background: #2563eb; }
.card-action-delete { background: var(--red); }

/* Inner wrapper that slides left on swipe */
.card-swipe-inner {
  position: relative;
  z-index: 2;
  background: var(--card);
  transform: translateX(0);
  transition: transform 0.25s ease;
  will-change: transform;
}

@media (max-width: 767px) {
  .card-swipe-actions { display: flex; }
}

/* Mobile swipe/tap hints — hidden on desktop */
.swipe-hint        { display: none; }
.swipe-hint-wrap   { display: none; }

@media (max-width: 767px) {

  /* Hint wrap — centered on first card */
  .swipe-hint-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    position: absolute;
    top: 14px;
    left: 0;
    right: 0;
    z-index: 5;
    pointer-events: none;
  }

  .swipe-hint {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    font-weight: 600;
    color: #1a1a1a;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    padding: 7px 14px 7px 10px;
    border-radius: 30px;
    white-space: nowrap;
    opacity: 0;
    animation: swipeHintFade 8s ease-out 0.8s forwards;
    box-shadow: 0 3px 12px rgba(0,0,0,0.22);
  }

  /* Pulsing tap hand image */
  .tap-hint-hand {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    animation: tapPulse 1.2s ease-in-out infinite;
  }

  /* Sliding swipe hand image */
  .swipe-hint-hand {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    animation: fingerSlide 2.4s ease-in-out infinite;
  }

  @keyframes fingerSlide {
    0%   { transform: translateX( 5px); opacity: 0.6; }
    50%  { transform: translateX(-5px); opacity: 1;   }
    100% { transform: translateX( 5px); opacity: 0.6; }
  }

  @keyframes tapPulse {
    0%   { transform: scale(1);    opacity: 1;   }
    40%  { transform: scale(0.75); opacity: 0.5; }
    100% { transform: scale(1);    opacity: 1;   }
  }

  @keyframes swipeHintFade {
    0%   { opacity: 0; }
    12%  { opacity: 0.75; }
    82%  { opacity: 0.75; }
    100% { opacity: 0; }
  }
}

/* -----------------------------------------------
   HEADER RIGHT — logout button group
----------------------------------------------- */
.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.btn-logout {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: rgba(255,255,255,0.7);
  transition: background 0.15s, color 0.15s;
  text-decoration: none;
}
.btn-logout:hover {
  background: rgba(255,255,255,0.12);
  color: #fff;
}

/* -----------------------------------------------
   LOGIN PAGE
----------------------------------------------- */
body.login-page {
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}
.login-wrap {
  width: 100%;
  max-width: 420px;
}
.login-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 4px 24px rgba(0,0,0,0.10);
  padding: 40px 36px;
}
.login-logo {
  display: block;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff;
  text-decoration: none;
  background: var(--header);
  padding: 10px 18px;
  border-radius: var(--btn-radius);
  margin-bottom: 28px;
  display: inline-block;
}
.login-logo span {
  color: var(--accent);
  margin-right: 4px;
}
.login-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 4px;
}
.login-sub {
  font-size: 15px;
  color: var(--muted);
  margin: 0 0 24px;
}
.login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.login-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.login-field label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.login-field input[type="email"],
.login-field input[type="password"],
.login-field input[type="text"] {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--btn-radius);
  font-family: 'Barlow', sans-serif;
  font-size: 16px;
  color: var(--text);
  background: #fff;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  box-sizing: border-box;
}
.login-field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(212,80,10,0.12);
}
.login-pw-wrap {
  position: relative;
}
.login-pw-wrap input {
  padding-right: 44px;
}
.login-pw-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  padding: 4px;
  display: flex;
  align-items: center;
}
.login-pw-toggle:hover { color: var(--accent); }
.login-remember {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
}
.login-remember input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
}
.btn-submit {
  width: 100%;
  padding: 12px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--btn-radius);
  font-family: 'Barlow', sans-serif;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
  box-shadow: inset 0 -2px 0 rgba(0,0,0,0.18);
}
.btn-submit:hover { background: #b84208; }
.btn-submit:active { transform: scale(0.98); }

@media (max-width: 480px) {
  .login-card { padding: 28px 20px; }
}
