/* urma.app — stylesheet
   Reverse-engineered from 2021 Safari/PDF screenshots.
   Color palette:
     primary navy  #1e466b   header, primary buttons, search
     primary dim   #173851   header darker variant
     accent teal   #26b8b8   secondary action buttons (printeaza, stoc categorii)
     red           #d9534f   delete, expired warranty, errors
     green         #28a745   valid warranty, scan green CTAs
     bg            #f5f5f6   body
     card          #ffffff
     text          #2b2b2b
     muted         #6c757d
*/

* { box-sizing: border-box; }
:root {
  /* Brand (theme-independent) */
  --navy: #1e466b;
  --navy-dim: #173851;
  --teal: #26b8b8;
  --teal-dark: #1ea3a3;
  --red: #d9534f;
  --green: #28a745;

  /* Surfaces — LIGHT */
  --bg: #f5f5f6;
  --bg-alt: #eaecee;
  --card: #ffffff;
  --card-2: #fafbfc;
  --card-glass: rgba(255, 255, 255, 0.72);
  --card-stroke: rgba(0, 0, 0, 0.06);
  --header-bg: #ffffff;
  --modal-bg: #ffffff;
  --modal-backdrop: rgba(0, 0, 0, 0.45);

  /* Text — LIGHT */
  --text: #1c1f23;
  --text-soft: #44474b;
  --muted: #6c757d;
  --text-dim: #8a8f95;
  --link: #2c5d8a;

  /* Borders, inputs */
  --border: rgba(0, 0, 0, 0.08);
  --border-soft: rgba(0, 0, 0, 0.04);
  --hairline: rgba(0, 0, 0, 0.10);
  --input-bg: #ffffff;
  --input-bg-soft: #f0f3f6;

  /* Shadows — light theme */
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 4px 14px rgba(0,0,0,.06);
  --shadow-card:
    inset 0 1px 0 rgba(255, 255, 255, 0.7),
    0 1px 1px rgba(15, 23, 42, 0.04),
    0 4px 12px rgba(15, 23, 42, 0.06),
    0 12px 24px rgba(15, 23, 42, 0.04);

  color-scheme: light;
}

/* Dark mode tokens — applied when:
     • user has system dark + theme is "auto" (no override), OR
     • user manually picked dark (data-theme="dark" on <html>)
   The :where() wrapper around html keeps specificity at 0 so the
   forced-light selector below can win over the media query. */
@media (prefers-color-scheme: dark) {
  :where(html:not([data-theme="light"])) {
    --bg: #0e1116;
    --bg-alt: #161a20;
    --card: #1b1f25;
    --card-2: #22272e;
    --card-glass: rgba(28, 32, 38, 0.62);
    --card-stroke: rgba(255, 255, 255, 0.08);
    --header-bg: #14171c;
    --modal-bg: #1c2026;
    --modal-backdrop: rgba(0, 0, 0, 0.65);

    --text: #e6e8eb;
    --text-soft: #c4c8cd;
    --muted: #9ba1a8;
    --text-dim: #6f757b;
    --link: #6db4e8;

    --border: rgba(255, 255, 255, 0.08);
    --border-soft: rgba(255, 255, 255, 0.04);
    --hairline: rgba(255, 255, 255, 0.10);
    --input-bg: rgba(255, 255, 255, 0.04);
    --input-bg-soft: rgba(255, 255, 255, 0.06);

    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 14px rgba(0,0,0,.4);
    --shadow-card:
      inset 0 1px 0 rgba(255, 255, 255, 0.05),
      0 1px 1px rgba(0, 0, 0, 0.4),
      0 4px 12px rgba(0, 0, 0, 0.5),
      0 12px 24px rgba(0, 0, 0, 0.3);

    color-scheme: dark;
  }
}

/* Manual override: user explicitly picked dark — applies regardless of OS */
html[data-theme="dark"] {
  --bg: #0e1116;
  --bg-alt: #161a20;
  --card: #1b1f25;
  --card-2: #22272e;
  --card-glass: rgba(28, 32, 38, 0.62);
  --card-stroke: rgba(255, 255, 255, 0.08);
  --header-bg: #14171c;
  --modal-bg: #1c2026;
  --modal-backdrop: rgba(0, 0, 0, 0.65);

  --text: #e6e8eb;
  --text-soft: #c4c8cd;
  --muted: #9ba1a8;
  --text-dim: #6f757b;
  --link: #6db4e8;

  --border: rgba(255, 255, 255, 0.08);
  --border-soft: rgba(255, 255, 255, 0.04);
  --hairline: rgba(255, 255, 255, 0.10);
  --input-bg: rgba(255, 255, 255, 0.04);
  --input-bg-soft: rgba(255, 255, 255, 0.06);

  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 14px rgba(0,0,0,.4);
  --shadow-card:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 1px 1px rgba(0, 0, 0, 0.4),
    0 4px 12px rgba(0, 0, 0, 0.5),
    0 12px 24px rgba(0, 0, 0, 0.3);

  color-scheme: dark;
}

/* Manual override: user explicitly picked light — wins over media query */
html[data-theme="light"] { color-scheme: light; }

html, body {
  margin: 0; padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 16px;
  color: var(--text);
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- Top bar (header) ---- */
.urma-header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 12px 16px;
  display: flex; align-items: center; gap: 12px;
  position: sticky; top: 0; z-index: 50;
}
.urma-header .brand {
  color: var(--link); font-weight: 600; font-size: 18px;
  flex: 1;
}
.urma-header .menu-toggle {
  background: var(--navy); color: #fff;
  width: 38px; height: 38px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 4px; border: none; cursor: pointer;
  font-size: 18px;
}
.urma-header .logout {
  color: var(--muted); display: inline-flex; align-items: center; gap: 6px;
  font-size: 15px;
}
.urma-header .logout:hover { color: var(--navy); text-decoration: none; }

/* ---- Page header ---- */
.page-head { padding: 20px 16px 8px; }
.page-head h1 {
  font-weight: 300; font-size: 36px; margin: 0 0 4px; color: var(--text-soft);
  letter-spacing: -0.5px;
}
.breadcrumb { font-size: 14px; color: var(--muted); }
.breadcrumb a { color: var(--muted); }
.breadcrumb .sep { margin: 0 6px; color: var(--text-dim); }
.breadcrumb .current { color: var(--text); font-weight: 600; }

hr.page-rule { border: 0; border-top: 1px solid #e9ecef; margin: 12px 0 16px; }

/* ---- Layout ---- */
.container { max-width: 720px; margin: 0 auto; padding: 0 16px 32px; }
.container-wide { max-width: 1100px; margin: 0 auto; padding: 0 16px 32px; }

/* ---- Cards ---- */
.card {
  background: var(--card-glass);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  border: 0.5px solid var(--card-stroke);
  border-radius: 14px;
  box-shadow: var(--shadow-card);
  margin-bottom: 16px;
  overflow: hidden;
}
.card-body { padding: 16px; }

/* ---- Filter bar (above products list) ---- */
.filter-bar {

  background: var(--card-glass);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  border: 0.5px solid var(--card-stroke);
  border-radius: 14px;
  box-shadow: var(--shadow-card);
  padding: 14px; margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.filter-bar .count-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px; flex-wrap: wrap; gap: 8px;
}
.filter-bar .count {
  color: var(--muted); font-size: 15px;
}
.filter-bar .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.filter-bar select,
.filter-bar input[type=text],
.filter-bar input[type=search] {
  width: 100%; padding: 9px 12px;
  border: 1px solid var(--border); border-radius: 4px;
  font-size: 15px; background: var(--card);
  margin-bottom: 8px;
}
.filter-bar input::placeholder { color: var(--text-dim); }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 16px; border-radius: 4px; border: 1px solid transparent;
  font-size: 15px; font-weight: 400; cursor: pointer;
  text-decoration: none; transition: filter .15s, background .15s;
  background: var(--card); color: var(--text);
}
.btn:hover { filter: brightness(.96); text-decoration: none; }
.btn-block { width: 100%; }
.btn-primary { background: var(--navy); color: #fff; border-color: var(--navy); }
.btn-primary:hover { background: var(--navy-dim); color: #fff; }
.btn-teal { background: var(--teal); color: #fff; border-color: var(--teal); }
.btn-teal:hover { background: var(--teal-dark); color: #fff; }
.btn-green { background: var(--green); color: #fff; border-color: var(--green); }
.btn-green:hover { background: #208a37; color: #fff; }
.btn-red { background: var(--red); color: #fff; border-color: var(--red); }
.btn-outline-red { background: transparent; color: var(--red); border-color: var(--red); }
.btn-outline-red:hover { background: var(--red); color: #fff; }
.btn-light { background: var(--card); color: var(--text); border-color: var(--border); }
.btn-grey { background: #cfd2d6; color: #fff; border-color: #cfd2d6; }
.btn-grey:hover { background: #b9bcc1; color: #fff; }
.btn-sm { padding: 5px 10px; font-size: 13px; }
.btn-lg { padding: 14px 18px; font-size: 16px; }

/* search button big square dark */
.btn-search {
  width: 100%; background: var(--navy); color: #fff; border: none;
  padding: 11px; border-radius: 4px; font-size: 17px; cursor: pointer;
}

/* ---- Product card (detailed list view) ---- */
.product-card {
  background: var(--card-glass);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  border: 0.5px solid var(--card-stroke);
  border-radius: 14px;
  box-shadow: var(--shadow-card);
  margin-bottom: 14px;
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}
.product-card .photo {
  position: relative; width: 100%;
  aspect-ratio: 16/11; background: var(--bg-alt);
  overflow: hidden;
}
.product-card .photo img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.product-card .photo .no-photo {
  display: flex; align-items: center; justify-content: center;
  height: 100%; color: var(--muted); font-size: 13px;
  font-style: italic;
}
.tag {
  position: absolute;
  background: var(--navy);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  padding: 6px 14px;
  border-radius: 3px;
  letter-spacing: 0.2px;
  z-index: 2;
}
.tag-site { top: 10px; left: 10px; }
.tag-brand { bottom: 10px; right: 10px; }

.product-card .body { padding: 14px 16px 18px; }
.product-card .body h3 {
  margin: 0 0 12px; font-size: 18px; font-weight: 600; color: var(--link);
  line-height: 1.25;
}
.product-card .body .meta {
  font-size: 14px; color: var(--text-soft); line-height: 1.65;
}
.product-card .body .meta .lbl { color: var(--text-soft); }
.product-card .body .meta a { color: var(--link); }
.product-card .body .meta span.k { color: var(--text-soft); }
.product-card .body .meta span.v.lk { color: var(--link); }

/* ---- Product card grid: 2 cols mobile, 3 tablet, 4 desktop ---- */
.product-grid {
  display: grid; gap: 12px;
  grid-template-columns: repeat(2, 1fr);
}
.product-grid .product-card { margin: 0; }
.product-grid .product-card .body { padding: 10px 12px 12px; }
.product-grid .product-card .body h3 { font-size: 14px; margin-bottom: 0; }
.product-grid .tag { font-size: 12px; padding: 4px 10px; }
@media (min-width: 600px) {
  .product-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 992px) {
  .product-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ---- Product detail (Istoric produs) ---- */
.product-head {
  margin: 4px 0 14px;
}
.product-head h2 {
  color: var(--link); font-size: 22px; font-weight: 700; margin: 0 0 6px;
}
.warranty {
  font-weight: 700; font-size: 17px; margin: 4px 0 14px;
}
.warranty.valid { color: var(--green); }
.warranty.expired { color: var(--red); }

.action-row {
  display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 14px;
}

.product-meta {
  font-size: 15px; line-height: 1.85; color: var(--text-soft); margin: 8px 0 22px;
}
.product-meta .lbl { color: var(--text-soft); }

/* ---- History table ---- */
table.history {
  width: 100%; border-collapse: collapse; font-size: 14px;
  margin-top: 12px; background: var(--card);
}
table.history thead th {
  text-align: left; padding: 10px 8px; font-weight: 700;
  border-bottom: 2px solid var(--hairline); color: var(--text);
}
table.history tbody td {
  padding: 14px 8px; border-bottom: 1px solid var(--border-soft); color: var(--text-soft);
}
table.history tbody tr:nth-child(even) { background: var(--card-2); }

/* ---- Footer ---- */
.urma-footer {
  margin-top: 30px;
  padding: 18px 16px;
  border-top: 1px solid var(--border);
  background: var(--card);
  text-align: left;
  font-size: 14px;
  color: var(--muted);
}
.urma-footer strong { color: var(--text); font-weight: 700; }

/* ---- Login ---- */
.login-page {
  min-height: 100vh; background: var(--bg);
  display: flex; align-items: flex-start; justify-content: center;
  padding-top: 6vh; position: relative; overflow: hidden;
}
.login-bg {
  position: absolute; inset: 0; pointer-events: none;
  display: flex; align-items: flex-start; justify-content: center;
  padding-top: 4vh;
  font-size: 110px; font-weight: 700; color: var(--bg-alt);
  letter-spacing: -3px; user-select: none;
}
.login-card {
  background: var(--card-glass);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  border: 0.5px solid var(--card-stroke);
  border-radius: 14px;
  box-shadow: var(--shadow-card);
  width: 100%; max-width: 380px;
  padding: 24px;
  margin: 0 auto;
}
.login-card .sub { color: var(--muted); margin-bottom: 18px; font-size: 15px; }
.login-card input[type=text],
.login-card input[type=password] {
  width: 100%; padding: 11px 14px; margin-bottom: 12px;
  border: 1px solid var(--border); border-radius: 4px;
  font-size: 15px;
}
.login-card .footer { margin-top: 16px; color: var(--muted); font-size: 13px; }

/* ---- Locked session ---- */
.locked-page {
  min-height: 100vh; background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.locked-card { width: 100%; max-width: 420px; text-align: center; padding: 0 8px; }
.locked-card .avatar {
  width: 110px; height: 110px; border-radius: 50%;
  background: var(--card); margin: 0 auto 16px;
  display: flex; align-items: center; justify-content: center;
  border: 4px solid var(--border); color: var(--navy);
  font-size: 60px;
}
.locked-card h3 { font-weight: 600; margin: 8px 0 6px; color: var(--text-soft); }
.locked-card p { color: var(--muted); margin: 4px 0 18px; line-height: 1.45; }
.locked-card input[type=password] {
  width: 100%; padding: 11px 14px; margin-bottom: 14px;
  border: 1px solid var(--border); border-radius: 4px;
  font-size: 15px; background: var(--input-bg-soft);
  text-align: center; letter-spacing: 4px;
}
.locked-card .logout-link {
  display: inline-block; margin-top: 12px; color: var(--link);
}
.locked-card .copyr { color: var(--muted); margin-top: 24px; font-size: 13px; }

/* ---- Sidebar (admin) ---- */
.layout-sidebar { display: flex; min-height: calc(100vh - 60px); }
.sidebar {
  width: 240px; background: var(--navy-dim); color: #c7d3df;
  padding: 16px 0; min-height: 100%;
  position: fixed; top: 60px; bottom: 0; left: 0;
  transform: translateX(-100%); transition: transform .2s;
  z-index: 40; overflow-y: auto;
}
.sidebar.open { transform: translateX(0); }
.sidebar .who {
  padding: 12px 18px 14px; border-bottom: 1px solid rgba(255,255,255,.07);
  margin-bottom: 8px;
}
.sidebar .who .name { color: #fff; font-weight: 600; }
.sidebar .who .role { font-size: 13px; color: #92a3b3; margin-top: 2px; }
.sidebar a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 18px; color: #c7d3df; font-size: 15px;
  border-left: 3px solid transparent; text-decoration: none;
}
.sidebar a:hover { background: rgba(255,255,255,.04); color: #fff; }
.sidebar a.active {
  background: var(--card); color: var(--navy); border-left-color: var(--teal);
}
.sidebar .group-title {
  padding: 14px 18px 4px; font-size: 12px; color: #6c8094;
  text-transform: uppercase; letter-spacing: .5px;
}

@media (min-width: 992px) {
  .sidebar { transform: translateX(0); }
  .with-sidebar .container,
  .with-sidebar .container-wide { margin-left: 240px; max-width: calc(100% - 240px); padding-left: 32px; padding-right: 32px; }
  .with-sidebar .urma-header .menu-toggle { display: none; }
}

/* ---- Modal ---- */
.modal-backdrop {
  position: fixed; inset: 0; background: var(--modal-backdrop);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  z-index: 200;
  display: none; align-items: center; justify-content: center;
  padding: 16px;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--card-glass);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  border: 0.5px solid var(--card-stroke);
  border-radius: 14px;
  box-shadow: var(--shadow-card);
  max-width: 560px; width: calc(100vw - 32px);
  max-height: 88vh; overflow-y: auto;
}
.modal-head {
  padding: 14px 18px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-head h3 { margin: 0; font-size: 18px; font-weight: 600; }
.modal-head .close {
  background: none; border: none; font-size: 22px; color: var(--muted);
  cursor: pointer; line-height: 1;
}
.modal-body { padding: 18px; }
.modal-foot {
  padding: 12px 18px; border-top: 1px solid var(--border);
  display: flex; gap: 8px; justify-content: flex-end;
}

/* ---- Forms ---- */
.field { margin-bottom: 14px; }
.field label {
  display: block; margin-bottom: 6px; font-size: 14px;
  color: var(--text-soft); font-weight: 600;
}
.field label .req { color: var(--red); margin-left: 2px; }
.field input[type=text],
.field input[type=tel],
.field input[type=date],
.field input[type=number],
.field input[type=password],
.field select,
.field textarea {
  width: 100%; padding: 9px 12px;
  box-sizing: border-box;
  border: 1px solid var(--border); border-radius: 4px;
  font-size: 15px; background: var(--card);
}
.field textarea { min-height: 80px; resize: vertical; }
.field-row { display: flex; gap: 8px; align-items: stretch; }
.field-row .prefix {
  background: var(--input-bg-soft); padding: 9px 12px; border: 1px solid var(--border);
  border-radius: 4px; color: var(--text-soft); font-size: 15px;
  display: inline-flex; align-items: center;
}
.field-suffix { display: flex; align-items: stretch; }
.field-suffix input { border-radius: 4px 0 0 4px; border-right: 0; }
.field-suffix .suffix {
  background: var(--input-bg-soft); padding: 0 14px; border: 1px solid var(--border);
  border-radius: 0 4px 4px 0; color: var(--text-soft); font-size: 14px;
  display: inline-flex; align-items: center;
}
.field-checkbox { display: flex; align-items: center; gap: 8px; }

/* ---- Useri table (mobile-style list) ---- */
.users-list { background: var(--card); border: 1px solid var(--border); border-radius: 6px;
  overflow: hidden; box-shadow: var(--shadow); }
.users-list .row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-bottom: 1px solid var(--border-soft);
}
.users-list .row:last-child { border-bottom: 0; }
.users-list .swatch {
  width: 22px; height: 22px; border-radius: 4px; flex-shrink: 0;
}
.users-list .uname { flex: 1; color: var(--text); }
.users-list .phone-link { color: var(--muted); }
.users-list .edit-btn {
  background: none; border: none; color: var(--muted); cursor: pointer;
  font-size: 18px; padding: 6px 8px;
}
.users-list .edit-btn:hover { color: var(--navy); }

.summary-row {
  background: var(--card-glass);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  border: 0.5px solid var(--card-stroke);
  border-radius: 14px;
  box-shadow: var(--shadow-card);
  padding: 12px 16px;
  margin-bottom: 16px;
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 10px;
}

/* ---- Categorii badges ---- */
.cat-badges { display: flex; flex-wrap: wrap; gap: 8px; }
.cat-badge {
  background: var(--card); border: 1px solid var(--border); border-radius: 999px;
  padding: 6px 14px; font-size: 14px; color: var(--text);
}
.cat-badge:hover { background: var(--input-bg-soft); text-decoration: none; }
.cat-badge .ct {
  background: var(--navy); color: #fff; border-radius: 10px;
  padding: 1px 8px; font-size: 12px; margin-left: 6px;
}

/* ---- Rapoarte / stats ---- */
.stats { display: grid; gap: 12px; grid-template-columns: repeat(3, 1fr); margin-bottom: 16px; }
.stat {
  background: var(--card); padding: 18px 16px; border: 1px solid var(--border);
  border-radius: 6px; text-align: center; box-shadow: var(--shadow);
}
.stat .v { font-size: 32px; font-weight: 700; color: var(--navy); }
.stat .l { font-size: 13px; color: var(--muted); margin-top: 4px; }

/* ---- Toasts / flash ---- */
.flashes { padding: 0 16px; }
.flash {
  background: var(--card); border-left: 4px solid var(--green);
  padding: 10px 14px; margin: 10px 0; border-radius: 4px;
  box-shadow: var(--shadow); font-size: 15px;
}
.flash.danger { border-left-color: var(--red); color: #832; }
.flash.success { border-left-color: var(--green); color: #1c5f30; }

/* ---- Scan flow buttons (big greens) ---- */
.scan-actions {
  display: flex; flex-direction: column; gap: 10px; margin: 16px 0;
}
.scan-actions .btn { padding: 14px 16px; font-size: 16px; }

/* ---- QR codes admin grid ---- */
.qr-grid {
  display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}
.qr-tile {
  background: var(--card-glass);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  border: 0.5px solid var(--card-stroke);
  border-radius: 14px;
  box-shadow: var(--shadow-card);
  padding: 12px;
  text-align: center;
  position: relative;
}
.qr-tile .slug { color: var(--navy); font-weight: 600; }
.qr-tile .bound { display: block; color: var(--green); margin-top: 4px; font-size: 11px; }
.qr-tile .free { display: block; color: var(--muted); margin-top: 4px; font-size: 11px; }

/* ---- Misc ---- */
.text-muted { color: var(--muted); }
.text-success { color: var(--green); }
.text-danger { color: var(--red); }
.text-center { text-align: center; }
.mt-2 { margin-top: 12px; } .mt-3 { margin-top: 18px; }
.mb-2 { margin-bottom: 12px; } .mb-3 { margin-bottom: 18px; }
.d-flex { display: flex; } .gap-2 { gap: 8px; } .gap-3 { gap: 12px; }
.flex-1 { flex: 1; }
.hidden { display: none !important; }

@media (max-width: 599px) {
  .stats { grid-template-columns: 1fr; }
}

/* ---- iOS zoom fix: any input < 16px triggers an unwanted zoom on tap ---- */
input, select, textarea, button {
  font-size: 16px;
}
.btn-sm, button.btn-sm { font-size: 13px; }

/* ---- History — dense iOS 26 glass cards on mobile ---- */
.history-wrap { margin-top: 12px; }
.history-cards { display: none; }

@media (max-width: 720px) {
  .history-wrap table.history { display: none; }
  .history-wrap { margin: 12px 0 0; padding: 0; overflow: visible; background: none; }

  .history-cards {
    display: block;
    list-style: none;
    margin: 0; padding: 0;
  }
  .hc {
    background: var(--card-glass);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    backdrop-filter: blur(20px) saturate(180%);
    border: 0.5px solid var(--card-stroke);
    border-radius: 14px;
    box-shadow: var(--shadow-card);
    padding: 9px 12px 10px;
    margin-bottom: 8px;
  }
  .hc-empty { padding: 18px 12px; }

  .hc-top {
    display: flex; align-items: center; justify-content: space-between;
    font-size: 11px; color: var(--muted);
    letter-spacing: 0.3px; line-height: 1.2;
  }
  .hc-when { font-variant-numeric: tabular-nums; }

  .hc-action {
    font-size: 15px; font-weight: 600; color: var(--text);
    margin: 4px 0 3px;
    line-height: 1.25;
    display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px;
  }
  .hc-arrow {
    color: var(--teal); font-weight: 400; margin: 0 2px 0 4px;
  }
  .hc-to {
    font-weight: 500; color: var(--text);
  }

  .hc-meta {
    font-size: 12px; color: var(--muted);
    line-height: 1.3;
  }

  .hc-where {
    display: flex; align-items: center; gap: 5px;
    margin-top: 5px;
    padding-top: 5px;
    border-top: 0.5px solid var(--border-soft);
    font-size: 11.5px;
    color: var(--muted);
    text-decoration: none;
    line-height: 1.2;
  }
  .hc-pin { font-size: 12px; flex: 0 0 auto; line-height: 1; }
  .hc-addr {
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    flex: 1;
  }
  .hc-where:active .hc-addr { color: var(--link); }
}

/* =========================================================================
   Notification engine — bell, dropdown, full list
   ========================================================================= */

.urma-header { position: relative; }
.header-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }

.theme-btn {
  background: transparent;
  border: 0;
  padding: 6px 8px;
  cursor: pointer;
  font-size: 16px;
  color: var(--text);
  border-radius: 8px;
  line-height: 1;
}
.theme-btn:hover { background: var(--input-bg-soft); }

.bell {
  position: relative;
  background: transparent;
  border: 0;
  padding: 6px 8px;
  cursor: pointer;
  font-size: 18px;
  color: var(--text);
  border-radius: 8px;
  line-height: 1;
}
.bell:hover { background: var(--input-bg-soft); }
.bell-icon { display: inline-block; }
.bell-badge {
  position: absolute;
  top: 1px; right: -2px;
  min-width: 16px; height: 16px;
  padding: 0 4px;
  background: var(--red);
  color: #fff;
  border-radius: 999px;
  font-size: 10px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
  line-height: 1;
}
.bell-badge[hidden] { display: none; }

.bell-menu {
  position: absolute;
  top: calc(100% + 4px); right: 12px;
  width: 320px; max-width: calc(100vw - 24px);
  background: var(--card);
  border: 0.5px solid var(--card-stroke);
  border-radius: 14px;
  box-shadow: var(--shadow-card);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  z-index: 100;
  overflow: hidden;
}
.bell-menu[hidden] { display: none; }
.bell-menu-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 14px;
  border-bottom: 0.5px solid var(--border-soft);
  font-weight: 600; font-size: 13px; color: var(--text);
}
.bell-all {
  font-size: 12px; color: var(--link); font-weight: 500;
  text-decoration: none;
}
.bell-list { list-style: none; margin: 0; padding: 0; max-height: 60vh; overflow-y: auto; }
.bell-item { border-bottom: 0.5px solid var(--border-soft); }
.bell-item:last-child { border-bottom: 0; }
.bell-item a {
  display: block; padding: 10px 14px;
  text-decoration: none; color: var(--text);
  position: relative;
}
.bell-item a:hover { background: var(--input-bg-soft); }
.bell-item.unread a { background: rgba(38, 184, 184, 0.06); }
.bell-dot {
  display: inline-block; width: 6px; height: 6px;
  background: var(--teal); border-radius: 999px;
  position: absolute; right: 12px; top: 16px;
}
.bell-title { font-size: 13px; font-weight: 600; line-height: 1.3; padding-right: 14px; }
.bell-body  { font-size: 12px; color: var(--muted); line-height: 1.3; margin-top: 2px;
              overflow: hidden; text-overflow: ellipsis; display: -webkit-box;
              -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.bell-when  { font-size: 11px; color: var(--text-dim); margin-top: 3px; }
.bell-empty { padding: 24px 14px; text-align: center; color: var(--muted); font-size: 13px; }

@media (max-width: 600px) {
  .bell-menu { right: 8px; width: calc(100vw - 16px); }
}

/* ---- Full notifications page ---- */
.notif-list { list-style: none; margin: 16px 0 0; padding: 0; }
.notif {
  background: var(--card-glass);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  border: 0.5px solid var(--card-stroke);
  border-radius: 14px;
  box-shadow: var(--shadow-card);
  margin-bottom: 8px;
  overflow: hidden;
}
.notif.unread { border-left: 3px solid var(--teal); }
.notif a, .notif > div {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 12px 14px;
  text-decoration: none; color: var(--text);
  position: relative;
}
.notif a:hover { background: var(--input-bg-soft); }
.notif-glyph { font-size: 22px; flex: 0 0 28px; line-height: 1; padding-top: 1px; }
.notif-body { flex: 1; min-width: 0; }
.notif-title { font-size: 14.5px; font-weight: 600; line-height: 1.3; }
.notif-text  { font-size: 13px; color: var(--text-soft); line-height: 1.4; margin-top: 2px;
               word-break: break-word; }
.notif-when  { font-size: 11.5px; color: var(--muted); margin-top: 4px;
               font-variant-numeric: tabular-nums; }
.notif-dot {
  width: 8px; height: 8px;
  background: var(--teal); border-radius: 999px;
  flex: 0 0 8px; margin-top: 7px;
}
.notif-empty {
  text-align: center; padding: 40px 16px;
  color: var(--muted); font-size: 14px;
}

/* ---- Card interactions: subtle lift on hover ---- */
@media (hover: hover) {
  .product-card:hover {
    transform: translateY(-1px);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.7),
      0 2px 4px rgba(15, 23, 42, 0.06),
      0 8px 18px rgba(15, 23, 42, 0.08),
      0 16px 32px rgba(15, 23, 42, 0.06);
  }
  @media (prefers-color-scheme: dark) {
    :where(html:not([data-theme="light"])) .product-card:hover {
      box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.06),
        0 2px 4px rgba(0, 0, 0, 0.4),
        0 8px 18px rgba(0, 0, 0, 0.5),
        0 16px 32px rgba(0, 0, 0, 0.35);
    }
  }
  html[data-theme="dark"] .product-card:hover {
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.06),
      0 2px 4px rgba(0, 0, 0, 0.4),
      0 8px 18px rgba(0, 0, 0, 0.5),
      0 16px 32px rgba(0, 0, 0, 0.35);
  }
}

/* Product cards: button-feel anchors, no underline on any state */
.product-card a,
.product-card a:hover,
.product-card a:visited,
.product-card a:active {
  text-decoration: none;
}

/* urma:date-appearance — iOS Safari ignores padding/alignment on
   <input type=date> because it uses native styling. Strip it so the
   date row matches text-input height and left-aligns like the rest. */
.field input[type="date"] {
  -webkit-appearance: none;
  appearance: none;
  text-align: left;
  /* match the visual height of other inputs (~38px with our padding) */
  line-height: 1.4;
  /* iOS still adds ~2px internal vertical padding even with appearance:none —
     trim ours slightly to compensate */
  padding-top: 8px;
  padding-bottom: 8px;
}
