/* Blastissimo Coffee — Application Styles
   Tokens ported from the Blastissimo Coffee design system (verde/lima/amarelo/azul/rosa/laranja
   palette, Baloo 2 + Work Sans type, pill controls, hairline borders, soft green-tinted shadows). */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* ---- Raw palette ---- */
  --verde-900:#0E2A1E;--verde-800:#164435;--verde-700:#1A6B47;--verde-600:#159257;--verde-500:#1FB765;--verde-400:#4FD489;--verde-300:#8AE7B2;--verde-200:#C2F4D8;--verde-100:#E6FBEF;
  --lima-600:#7FBF13;--lima-500:#A3DC1F;--lima-400:#BFEB55;--lima-200:#E4F8B4;--lima-100:#F3FCDF;
  --amarelo-700:#C99000;--amarelo-600:#EFB300;--amarelo-500:#FFC93C;--amarelo-400:#FFDA75;--amarelo-200:#FFEFC2;--amarelo-100:#FFF9E7;
  --azul-900:#0B2350;--azul-800:#123B7E;--azul-600:#1B6BD6;--azul-500:#2E9BEA;--azul-400:#6CC0F5;--azul-200:#C2E6FB;--azul-100:#EAF6FE;
  --rosa-700:#B31A5C;--rosa-600:#E02779;--rosa-500:#FF5C9D;--rosa-300:#FFA3C6;--rosa-100:#FFEBF3;
  --laranja-700:#C25200;--laranja-600:#EE6C0A;--laranja-500:#FF8A3D;--laranja-300:#FFBE8F;--laranja-100:#FFF0E4;
  --branco:#FFFFFF;--neve-100:#FFFFFF;--neve-200:#F7FBF8;--neve-300:#EDF4EF;--neve-400:#E1EBE4;
  --pedra-300:#C8D4CB;--pedra-400:#9DAAA1;--pedra-500:#6E7C73;
  --tinta-900:#0E2A1E;--tinta-800:#16362A;--tinta-700:#274A3D;--tinta-500:#5A6F64;

  --border-hairline:#DDE8E0;
  --border-ink:#CBD9CF;

  /* ---- Semantic aliases used throughout the app ---- */
  --color-midnight:       var(--verde-700);
  --color-midnight-hover: var(--verde-600);
  --color-midnight-light: var(--verde-100);
  --color-sunglow:        var(--amarelo-500);
  --color-sunglow-hover:  var(--amarelo-400);
  --color-sunglow-light:  var(--amarelo-100);
  --color-mist:           var(--neve-300);
  --color-white:          var(--branco);
  --color-carbon:         var(--tinta-800);

  --color-navy:         var(--verde-700);
  --color-navy-hover:   var(--verde-600);
  --color-accent:       var(--verde-600);
  --color-accent-hover: var(--verde-500);
  --color-bg:           var(--neve-200);
  --color-text:         var(--tinta-800);
  --color-border:       var(--border-hairline);
  --color-muted:        var(--tinta-500);

  --color-success: var(--verde-700);
  --color-warning: var(--laranja-700);
  --color-danger:  var(--rosa-700);
  --color-info:    var(--azul-600);

  /* Typography */
  --font-display: "Baloo 2", "Trebuchet MS", sans-serif;
  --font:      "Work Sans", "Helvetica Neue", Arial, sans-serif;
  --font-mono: var(--font); /* deprecated alias — this brand has no monospace face */

  /* Shape + elevation */
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-pill: 999px;
  --radius: var(--radius-lg);

  --shadow-xs: 0 1px 2px rgba(14,42,30,.05);
  --shadow-sm: 0 2px 8px rgba(14,42,30,.08);
  --shadow-md: 0 12px 28px -10px rgba(14,42,30,.18);
  --shadow-lg: 0 28px 64px -18px rgba(14,42,30,.22);

  --dur-fast: 140ms;
  --dur-base: 220ms;
  --ease-out: cubic-bezier(.2,.8,.2,1);
}

body {
  font-family: var(--font);
  font-size: 15px;
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  color: var(--tinta-900);
  letter-spacing: -0.01em;
  line-height: 1.15;
}

a { color: var(--verde-700); }
a:hover { color: var(--rosa-600); }

:focus-visible {
  outline: 2px solid var(--verde-500);
  outline-offset: 2px;
}

code {
  font-family: var(--font);
}

/* ── Layout ── */

.app-layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── Top nav (brand + primary links — replaces the old fixed sidebar) ── */

.sidebar {
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
  height: auto;
  overflow: visible;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 28px;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border-hairline);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  padding: 14px 0;
  margin-right: 8px;
  text-decoration: none;
}

.sidebar-logo,
.sidebar-wordmark {
  font: 800 24px/1 var(--font-display);
  letter-spacing: -0.02em;
  color: var(--verde-700);
  white-space: nowrap;
}

.sidebar-nav {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 0;
  flex-wrap: wrap;
}

.sidebar-section-label { display: none; }

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  color: var(--tinta-700);
  text-decoration: none;
  font: 600 14px/1 var(--font-display);
  border-left: none;
  border-radius: var(--radius-pill);
  transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}

.sidebar-nav a:hover {
  background: var(--verde-100);
  color: var(--verde-700);
}

.sidebar-nav a.active {
  background: var(--verde-600);
  color: #fff;
}

.sidebar-nav .nav-icon {
  width: auto;
  font-size: 14px;
  flex-shrink: 0;
}

/* ── Main area ── */

.main-wrapper {
  margin-left: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.header-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--laranja-600);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font: 700 13px/1 var(--font-display);
  cursor: pointer;
}

/* ── Content ── */

.content-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: transparent;
  overflow: visible;
}

.page-content {
  flex: 1;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 32px 28px 72px;
}

/* ── Page header row ── */

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

.page-header h1 {
  font: 800 28px/1.15 var(--font-display);
  color: var(--tinta-900);
}

/* ── Buttons ── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 22px;
  border-radius: var(--radius-pill);
  font: 700 15px/1 var(--font-display);
  letter-spacing: 0.005em;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);
  box-shadow: var(--shadow-xs);
}

.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn:active { transform: none; box-shadow: var(--shadow-xs); }

.btn-primary { background: var(--verde-600); color: #fff; }
.btn-primary:hover { background: var(--verde-500); }

.btn-secondary { background: var(--amarelo-500); color: var(--tinta-900); }
.btn-secondary:hover { background: var(--amarelo-400); }

.btn-outline {
  background: transparent;
  color: var(--tinta-900);
  border: 1px solid var(--border-ink);
  box-shadow: none;
}

.btn-outline:hover { background: var(--verde-100); border-color: var(--verde-200); box-shadow: none; }

.btn-danger { background: var(--rosa-600); color: #fff; }
.btn-danger:hover { background: var(--rosa-700); }

.btn-rosa { background: var(--rosa-600); color: #fff; }
.btn-rosa:hover { background: var(--rosa-700); }

.btn-azul { background: var(--azul-600); color: #fff; }
.btn-azul:hover { background: var(--azul-500); }

.btn-laranja { background: var(--laranja-600); color: #fff; }
.btn-laranja:hover { background: var(--laranja-500); }

.btn-sm {
  height: 36px;
  padding: 0 16px;
  font-size: 13px;
}

/* ── Cards ── */

.card {
  background: var(--branco);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border-hairline);
}

.card-title {
  font: 700 16px/1.2 var(--font-display);
  color: var(--tinta-900);
}

.card-body {
  padding: 22px;
}

/* ── Stats row ── */

.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--verde-100);
  border: 1px solid var(--verde-200);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  box-shadow: var(--shadow-xs);
}

.stats-row .stat-card:nth-of-type(3n+2) { background: var(--rosa-100); border-color: var(--rosa-300); }
.stats-row .stat-card:nth-of-type(3n+3) { background: var(--azul-100); border-color: var(--azul-200); }

.stat-label {
  font: 700 12px/1 var(--font);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--tinta-700);
  opacity: .8;
  margin-bottom: 8px;
}

.stat-value {
  font: 800 30px/1.1 var(--font-display);
  color: var(--tinta-900);
}

.stat-sub {
  font-size: 12px;
  color: var(--tinta-700);
  opacity: .8;
  margin-top: 6px;
}

/* ── Table ── */

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead th {
  padding: 12px 18px;
  text-align: left;
  font: 700 12px/1 var(--font);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--tinta-700);
  background: var(--neve-300);
  border-bottom: 1px solid var(--border-hairline);
}

tbody tr {
  border-bottom: 1px solid var(--border-hairline);
  transition: background .1s;
}

tbody tr:last-child { border-bottom: none; }

tbody tr:hover { background: var(--neve-200); }

tbody td {
  padding: 14px 18px;
  font-size: 14px;
  color: var(--color-text);
}

.table-link {
  color: var(--verde-700);
  text-decoration: none;
  font-weight: 600;
}

.table-link:hover { text-decoration: underline; }

/* ── Badges ── */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  font: 600 12px/1.2 var(--font);
  letter-spacing: 0.02em;
}

.badge-new        { background: var(--azul-100);    color: var(--azul-600); }
.badge-contacted  { background: var(--laranja-100); color: var(--laranja-700); }
.badge-qualified  { background: var(--verde-100);   color: var(--verde-700); }
.badge-converted  { background: var(--lima-100);    color: var(--lima-600); }
.badge-disqualified { background: var(--rosa-100);  color: var(--rosa-700); }

.badge-open    { background: var(--verde-100);   color: var(--verde-700); }
.badge-intake  { background: var(--laranja-100); color: var(--laranja-700); }
.badge-pending { background: var(--azul-100);    color: var(--azul-600); }
.badge-closed  { background: var(--neve-300);    color: var(--tinta-500); }
.badge-archived { background: var(--neve-300);   color: var(--tinta-500); }

.badge-todo       { background: var(--neve-300); color: var(--tinta-500); }
.badge-inprogress { background: var(--azul-100); color: var(--azul-600); }
.badge-done       { background: var(--verde-100); color: var(--verde-700); }
.badge-cancelled  { background: var(--rosa-100); color: var(--rosa-700); }

.badge-low    { background: var(--neve-300);    color: var(--tinta-500); }
.badge-medium { background: var(--laranja-100); color: var(--laranja-700); }
.badge-high   { background: var(--rosa-100);    color: var(--rosa-700); }
.badge-urgent { background: var(--rosa-600);    color: #fff; }

.badge-paid       { background: var(--verde-100); color: var(--verde-700); }
.badge-processing { background: var(--laranja-100); color: var(--laranja-700); }
.badge-shipped    { background: var(--azul-100);  color: var(--azul-600); }
.badge-delivered  { background: var(--verde-100); color: var(--verde-700); }
.badge-refunded   { background: var(--neve-300);  color: var(--tinta-500); }

.badge-active   { background: var(--verde-100);   color: var(--verde-700); }
.badge-pastdue  { background: var(--rosa-100);    color: var(--rosa-700); }
.badge-paused   { background: var(--laranja-100); color: var(--laranja-700); }

/* ── Detail layout ── */

.detail-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 20px;
  align-items: start;
}

.detail-main { min-width: 0; }
.detail-side { display: flex; flex-direction: column; gap: 16px; }

/* ── Product images ── */

.product-thumb {
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: var(--radius) var(--radius) 0 0;
  background: var(--neve-300);
}

.product-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.product-thumb-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--pedra-400);
  font-size: 40px;
}

.product-thumb-large {
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  margin-bottom: 20px;
}

.product-gallery { margin-bottom: 20px; }

.product-gallery-main {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--neve-300);
  margin-bottom: 10px;
}

.product-gallery-main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.product-gallery-thumbs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.product-gallery-thumbs img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color var(--dur-fast) var(--ease-out);
}

.product-gallery-thumbs img:hover { border-color: var(--verde-300); }

/* ── Definition list ── */

.def-list {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 12px 16px;
  font-size: 14px;
}

.def-label {
  font-weight: 600;
  color: var(--color-muted);
}

.def-value {
  color: var(--color-text);
}

/* ── Section titles ── */

.section-title {
  font: 700 13px/1 var(--font);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--color-muted);
  margin-bottom: 14px;
}

/* ── Notes / Comments ── */

.notes-block {
  background: var(--neve-300);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  font-size: 14px;
  color: var(--color-text);
  line-height: 1.6;
  white-space: pre-wrap;
}

.comment-list { display: flex; flex-direction: column; gap: 12px; }

.comment {
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  background: var(--branco);
}

.comment-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.comment-author {
  font-weight: 700;
  font-size: 13px;
  color: var(--color-text);
}

.comment-date {
  font-size: 12px;
  color: var(--color-muted);
}

.comment-body {
  font-size: 14px;
  color: var(--color-text);
  line-height: 1.5;
}

/* ── Form elements ── */

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.form-label {
  font: 600 13px/1.2 var(--font);
  color: var(--tinta-900);
}

.form-control {
  width: 100%;
  height: 46px;
  padding: 0 18px;
  border: 1px solid var(--border-ink);
  border-radius: var(--radius-pill);
  font: 400 15px/1 var(--font);
  color: var(--color-text);
  background: var(--branco);
  transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
  outline: none;
}

.form-control:focus {
  border-color: var(--verde-500);
  box-shadow: 0 0 0 4px var(--verde-100);
}

select.form-control {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  padding-right: 44px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%235A6F64' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'></polyline></svg>");
  background-repeat: no-repeat;
  background-position: right 16px center;
}

textarea.form-control {
  height: auto;
  min-height: 90px;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  resize: vertical;
}

.form-hint {
  font-size: 12px;
  color: var(--color-muted);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* ── Settings layout (pill tab bar, à la the design system's Tabs component) ── */

.settings-layout {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.settings-nav {
  display: inline-flex;
  align-self: flex-start;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  background: var(--neve-300);
  border: none;
  border-radius: var(--radius-pill);
  overflow: visible;
}

.settings-nav a {
  display: block;
  padding: 9px 18px;
  font: 600 14px/1 var(--font-display);
  color: var(--tinta-500);
  text-decoration: none;
  border-left: none;
  border-radius: var(--radius-pill);
  transition: all var(--dur-fast) var(--ease-out);
}

.settings-nav a:hover { color: var(--tinta-900); }

.settings-nav a.active {
  background: var(--branco);
  color: var(--tinta-900);
  border-left: none;
  box-shadow: var(--shadow-xs);
}

.settings-section { display: none; }
.settings-section.active { display: block; }

/* ── Divider ── */

.divider {
  height: 1px;
  background: var(--border-hairline);
  margin: 20px 0;
}

/* ── Empty state ── */

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--color-muted);
}

.empty-state-icon {
  font-size: 40px;
  margin-bottom: 12px;
  opacity: 0.4;
  color: var(--verde-600);
}

.empty-state h3 {
  font-size: 17px;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 6px;
}

.empty-state p { font-size: 14px; }

/* ── Linked items list ── */

.linked-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-hairline);
}

.linked-item:last-child { border-bottom: none; }

.linked-item-title {
  font-weight: 600;
  color: var(--verde-700);
  text-decoration: none;
}

.linked-item-title:hover { text-decoration: underline; }

.linked-item-meta {
  font-size: 12px;
  color: var(--color-muted);
  margin-top: 2px;
}

/* ── Footer ── */

.app-footer {
  border-top: 1px solid var(--border-hairline);
  padding: 16px 28px;
  font-size: 12px;
  color: var(--color-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ── Filter bar ── */

.filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.filter-bar .form-control {
  width: auto;
  min-width: 160px;
}

.search-input {
  min-width: 240px;
}

/* ── Alerts (inside app layout) ── */

.alert {
  padding: 13px 18px;
  border-radius: var(--radius-md);
  font-size: 14px;
  margin-bottom: 20px;
  position: relative;
}

.alert-error   { background: var(--rosa-100);   border: 1px solid var(--rosa-300);    color: var(--rosa-700); }
.alert-success { background: var(--verde-100);  border: 1px solid var(--verde-200);   color: var(--verde-700); }
.alert-info    { background: var(--azul-100);   border: 1px solid var(--azul-200);    color: var(--azul-600); }

.alert-dismissible { padding-right: 40px; }

.alert-close {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: inherit;
  opacity: 0.6;
  line-height: 1;
  padding: 0;
}

.alert-close:hover { opacity: 1; }

/* ── Header actions (cart + user menu, pinned right) ── */

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
  flex-shrink: 0;
}

.btn-cart-header {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 18px;
  border-radius: var(--radius-pill);
  font: 700 14px/1 var(--font-display);
  background: var(--rosa-600);
  color: #fff;
  text-decoration: none;
  box-shadow: var(--shadow-xs);
  transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);
}

.btn-cart-header:hover {
  background: var(--rosa-700);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.btn-cart-header .cart-count-badge {
  background: #fff;
  color: var(--rosa-700);
}

/* ── User dropdown ── */

.header-user-menu {
  position: relative;
  flex-shrink: 0;
}

/* ── Public shop nav ── */

.shop-nav-auth {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.cart-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--radius-pill);
  background: var(--rosa-600);
  color: #fff;
  font: 700 11px/1 var(--font-display);
}

/* ── Mobile nav toggle (hamburger) ── */

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  color: var(--tinta-900);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  border-radius: var(--radius-sm);
  order: 1;
}

.nav-toggle:hover { background: var(--verde-100); }

.user-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  background: var(--branco);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  min-width: 200px;
  z-index: 200;
}

.user-dropdown.open { display: block; }

.user-dropdown-header {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.user-dropdown-header strong {
  font-size: 14px;
  color: var(--color-text);
}

.user-dropdown-header span {
  font-size: 12px;
  color: var(--color-muted);
}

.user-dropdown a {
  display: block;
  padding: 10px 16px;
  font-size: 14px;
  color: var(--color-text);
  text-decoration: none;
  transition: background 0.1s;
}

.user-dropdown a:hover { background: var(--neve-200); }

.user-dropdown-divider {
  height: 1px;
  background: var(--border-hairline);
}

.user-dropdown-danger { color: var(--rosa-700) !important; }

/* ── Pagination ── */

.pagination {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 14px 16px;
  border-top: 1px solid var(--border-hairline);
  font-size: 13px;
}

.pagination a, .pagination span {
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  text-decoration: none;
  color: var(--color-text);
}

.pagination a:hover { background: var(--neve-200); }
.pagination .current { background: var(--verde-600); color: #fff; }
.pagination .disabled { color: var(--color-muted); }

/* ── Note form inline ── */

.note-form {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-hairline);
}

.note-form textarea {
  flex: 1;
  min-height: 60px;
}

/* ── Badge extra variants ── */

.badge-client          { background: var(--azul-100);    color: var(--azul-600); }
.badge-opposing_party  { background: var(--rosa-100);    color: var(--rosa-700); }
.badge-witness         { background: var(--laranja-100); color: var(--laranja-700); }
.badge-expert          { background: var(--lima-100);    color: var(--lima-600); }
.badge-court_personnel { background: var(--verde-100);   color: var(--verde-700); }
.badge-other           { background: var(--neve-300);    color: var(--tinta-500); }

.badge-in_progress { background: var(--azul-100); color: var(--azul-600); }

/* ── Header omni-search (unused today, kept themed for future use) ── */

.header-search {
  display: flex;
  align-items: center;
  gap: 0;
  position: relative;
}

.header-search-input {
  width: 420px;
  height: 42px;
  padding: 0 44px 0 18px;
  border-radius: var(--radius-pill);
  font: 400 14px/1 var(--font);
  border: 1px solid var(--border-ink);
  background: var(--branco);
  color: var(--color-text);
  transition: width 0.2s, border-color 0.15s, background 0.15s;
  outline: none;
}

.header-search-input::placeholder {
  color: var(--tinta-500);
}

.header-search-input:focus {
  width: 480px;
  border-color: var(--verde-500);
  box-shadow: 0 0 0 4px var(--verde-100);
}

.header-search-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  color: var(--tinta-500);
  padding: 0;
  line-height: 1;
}

.header-search-btn:hover {
  color: var(--verde-600);
}

/* ── Responsive ── */

@media (max-width: 860px) {
  .sidebar {
    flex-wrap: wrap;
    padding: 0 16px;
    row-gap: 4px;
  }

  .sidebar-brand { order: 0; }

  .nav-toggle {
    display: flex;
    order: 1;
    margin-left: auto;
    width: 48px;
    height: 48px;
    font-size: 28px;
  }

  /* Cart + profile collapse into the same hamburger-toggled panel as the nav links, instead of
     staying pinned to the top bar — there's no room for them next to the brand on a phone. */
  .header-actions {
    order: 4;
    margin-left: 0;
    flex-basis: 100%;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 10px 0 14px;
    border-top: 1px solid var(--border-hairline);
  }

  .sidebar.nav-open .header-actions { display: flex; }

  .btn-cart-header { width: 100%; justify-content: center; }

  .header-user-menu { width: 100%; }

  /* The avatar is just a click target to reveal the dropdown on desktop; on mobile the panel is
     already open, so show the account links inline instead of requiring a second tap. */
  .header-avatar { display: none; }

  .user-dropdown {
    display: block;
    position: static;
    width: 100%;
    min-width: 0;
    border: none;
    box-shadow: none;
  }

  .sidebar-nav {
    order: 3;
    flex-basis: 100%;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 6px 0 14px;
  }

  .sidebar.nav-open .sidebar-nav { display: flex; }

  .sidebar-nav a { width: 100%; }

  .shop-nav-auth { flex-wrap: wrap; width: 100%; }

  .page-content { padding: 20px 16px 56px; }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .detail-layout { grid-template-columns: 1fr; }

  .form-row { grid-template-columns: 1fr; }

  .def-list { grid-template-columns: 110px 1fr; }

  .app-footer {
    flex-direction: column;
    gap: 4px;
    text-align: center;
  }

  .header-search-input,
  .header-search-input:focus { width: 100%; }
}

@media (max-width: 480px) {
  .btn-cart-header span.btn-cart-label { display: none; }
}

/* ── Mobile "go to checkout" bar ── */
/* Hidden on desktop — the header cart button already covers this. Rendered only when the
   viewer's cart has items (see templates/partials/footer.php and templates/shop/partials/footer.php). */

.mobile-checkout-bar { display: none; }

@media (max-width: 860px) {
  .mobile-checkout-bar {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 150;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
    background: var(--branco);
    border-top: 1px solid var(--border-hairline);
    box-shadow: 0 -4px 16px rgba(0, 0, 0, .08);
  }

  .mobile-checkout-bar .btn {
    width: 100%;
    justify-content: center;
    gap: 8px;
  }

  .mobile-checkout-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, .25);
    font: 700 12px/1 var(--font-display);
  }

  /* Keep page content clear of the fixed bar when it's showing. (.mobile-checkout-bar is a
     sibling of .app-layout, not a descendant, so :has() is anchored at body.) */
  body:has(.mobile-checkout-bar) .page-content { padding-bottom: 100px; }
}
