/*
Theme Name: Delivery Theme
Theme URI: https://example.com/delivery-theme
Author: Codex
Author URI: https://example.com
Description: Minimal custom theme for delivery project. Includes a simple login page template.
Version: 0.1.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: delivery-theme
*/

@import url("styles/sidebar.css");

/* Base reset and typography */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Helvetica Neue", Arial, sans-serif;
  color: #1f2933;
  background: #f5f7fa;
}

html {
  margin: 0;
  margin-top: 0 !important;
  padding: 0;
}

/* Do not push layout down because of admin bar */
body.admin-bar {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

#wpadminbar {
  position: fixed;
  top: 0;
}

#wpadminbar {
  position: fixed;
}

:root {
  --primary: #151067;
  --primary-hover: #100c4f;
  --primary-shadow: rgba(21, 16, 103, 0.35);
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: none;
}

.container {
  width: 100%;
  max-width: 1600px;
  margin: 24px auto 0 auto;
  padding: 0 24px;
}

.site-header {
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
  padding: 10px 0;
}

.site-brand {
  font-weight: 700;
  color: #111827;
}

.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
}

.site-header .logo-img {
  height: 50px;
  display: block;
}

.site-footer {
  padding: 10px 0 15px;
  padding-left: 260px;
  text-align: center;
  color: #6b7280;
  position: relative;
  z-index: 1;
}

/* Login page styles */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 48px 16px;
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: #ffffff;
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.12);
  padding: 32px;
}

.login-card h1 {
  margin: 0 0 8px;
  font-size: 18px;
  letter-spacing: -0.25px;
}

.login-card p.lead {
  margin: 0 0 24px;
  color: #52606d;
}

.login-card form .input-group {
  margin-bottom: 16px;
}

.login-card form p {
  margin: 0 0 16px;
}

.login-card label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  color: #334155;
}

.login-card input[type="text"],
.login-card input[type="password"] {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  font-size: 14px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.password-field {
  position: relative;
  width: 100%;
}

.password-field input[type="password"],
.password-field input[type="text"] {
  padding-right: 46px;
}

.password-toggle {
  all: unset;
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  color: #64748b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  transition: color 0.15s ease, opacity 0.15s ease;
  z-index: 2;
  box-sizing: border-box;
}

.password-toggle:hover {
  color: #151067;
}

.password-toggle:focus-visible {
  outline: 2px solid rgba(21, 16, 103, 0.25);
  outline-offset: 2px;
}

.password-toggle.is-visible {
  color: #151067;
}

.password-toggle svg {
  width: 18px;
  height: 18px;
  display: block;
}

.login-card input[type="text"]:focus,
.login-card input[type="password"]:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(21, 16, 103, 0.15);
}

.login-card .remember {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0 16px;
  color: #52606d;
}

.login-card button[type="submit"] {
  width: 100%;
  padding: 12px;
  background: var(--primary);
  border: none;
  border-radius: 10px;
  color: #ffffff;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.login-card input[type="submit"] {
  width: 100%;
  padding: 12px;
  background: var(--primary);
  border: none;
  border-radius: 10px;
  color: #ffffff;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.login-card input[type="submit"]:hover {
  background: var(--primary-hover);
  box-shadow: 0 12px 30px var(--primary-shadow);
}

.login-card input[type="submit"]:active {
  transform: translateY(1px);
}

.login-card button[type="submit"]:hover {
  background: var(--primary-hover);
  box-shadow: 0 12px 30px var(--primary-shadow);
}

.login-card button[type="submit"]:active {
  transform: translateY(1px);
}

.login-card .helper-links {
  margin-top: 16px;
  display: flex;
  justify-content: space-between;
  font-size: 14px;
}

.login-card .login-remember {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #52606d;
}

.login-card .notice {
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.4;
}

.login-card .notice.error {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.login-card .notice.success {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.logged-in-box {
  text-align: center;
  padding: 32px 16px;
}

.logged-in-box a {
  font-weight: 600;
}

.login-langs-wrap {
  margin-top: 14px;
  display: flex;
  justify-content: center;
  width: 100%;
}

.login-langs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.login-langs__pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  background: #fff;
  color: inherit;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.login-langs__pill:hover {
  background: #f3f4f6;
  border-color: #d1d5db;
}

.login-langs__flag {
  font-size: 18px;
  line-height: 1;
}

/* Dashboard layout */
:root {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --border: #e5e7eb;
  --text: #1f2937;
  --muted: #6b7280;
  --primary: #151067;
  --primary-hover: #100c4f;
  --primary-shadow: rgba(21, 16, 103, 0.35);
}


.profile-meta-card {
  padding: 16px;
}

.profile-shipping-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.profile-shipping-card__header {
  gap: 8px;
}

.profile-shipping-card__summary {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.profile-shipping-card__terminal {
  font-weight: 600;
  color: #334155;
}

.profile-shipping-card__hint {
  font-size: 13px;
  line-height: 1.45;
  color: #64748b;
}

.cg-tg-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cg-tg-title {
  font-weight: 700;
  color: #111827;
}

.cg-tg-subtitle {
  font-size: 12px;
  line-height: 1.45;
  color: #64748b;
}

.cg-tg-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: #334155;
}

.cg-tg-status .icon {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: #fff;
  flex: 0 0 18px;
}

.cg-tg-status.ok .icon {
  background: #27ae60;
}

.cg-tg-status.not .icon {
  background: #e74c3c;
}

.cg-tg-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.cg-tg-muted {
  font-size: 12px;
  line-height: 1.45;
  color: #64748b;
  min-height: 1.45em;
}

.shipping-terminal-picker {
  position: relative;
  width: 100%;
}

.shipping-terminal-search {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 14px;
  background: #fff;
  box-sizing: border-box;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.shipping-terminal-search:focus {
  outline: none;
  border-color: rgba(21, 16, 103, 0.32);
  box-shadow: 0 0 0 4px rgba(21, 16, 103, 0.12);
}

.shipping-terminal-suggest-list {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 30;
  background: #ffffff;
  border: 1px solid #dbe3f0;
  border-radius: 12px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.14);
  max-height: 280px;
  overflow: auto;
  padding: 6px;
}

.shipping-terminal-suggest-item {
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 10px 12px;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  cursor: pointer;
}

.shipping-terminal-suggest-item strong {
  font-size: 14px;
  line-height: 1.4;
  color: #0f172a;
}

.shipping-terminal-suggest-item span {
  font-size: 12px;
  color: #64748b;
}

.shipping-terminal-suggest-item mark {
  padding: 0 4px;
  border-radius: 4px;
  background: rgba(250, 204, 21, 0.38);
  color: #92400e;
  font-weight: 700;
}

.shipping-terminal-suggest-item:hover,
.shipping-terminal-suggest-item.is-active {
  background: #f8fafc;
}

.shipping-terminal-suggest-empty {
  padding: 10px 12px;
  color: #94a3b8;
  font-size: 13px;
}

.profile-grid {
  display: grid;

  gap: 12px;
}


.profile-grid--splitcards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 12px;
}

.profile-grid--splitcards+.profile-grid--splitcards {
  margin-top: 18px;
}

.profile-grid--stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.stack-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stack-row--grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.stack-row--split-cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.split-cols__left,
.split-cols__right {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.meta-col {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.meta-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0;
  background: transparent;
  border: none;
}

.meta-row--split .split-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
}

.meta-row--split .split-row input {
  width: 100%;
}

.meta-key {
  font-weight: 700;
  color: #111827;
}

.meta-val {
  color: #334155;
}

.flag-radio-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.flag-radio {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  background: transparent;
  transition: opacity 0.25s ease, transform 0.18s ease;
}

.flag-radio input {
  display: none;
}

.flag-radio__flag {
  font-size: 28px;
  transition: opacity 0.25s ease, transform 0.18s ease, color 0.18s ease;
}

.flag-radio {
  opacity: 0.65;
}

.flag-radio input:checked+.flag-radio__flag {
  color: var(--primary);
}

.flag-radio input:checked {
  /* for :has compatibility fallback, we toggle opacity via JS-friendly cascade */
}

.flag-radio input:checked~.flag-radio__flag {
  color: var(--primary);
  transform: scale(1.08);
  opacity: 1;
}

.flag-radio input:not(:checked)~.flag-radio__flag {
  opacity: 0.35;
}

.profile-form input[type="text"],
.profile-form input[type="email"],
.profile-form input[type="tel"],
.profile-form input[type="number"],
.profile-form input.qty-input,
.profile-form select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  font-size: 14px;
}

.profile-form input.qty-input {
  -moz-appearance: textfield;
}

.profile-form textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  font-size: 14px;
  resize: none;
  min-height: 120px;
}

.profile-form input[type="number"] {
  -moz-appearance: textfield;
}

.profile-form input[type="number"]::-webkit-inner-spin-button,
.profile-form input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.profile-form input[readonly],
.profile-form select:disabled {
  background: #f1f5f9;
  color: #475569;
}

.toggle-row {
  align-items: center;
  justify-content: space-between;
}

.toggle-row .meta-key {
  min-width: auto;
}

.form-actions {
  margin-top: 16px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
}

.logout-btn {
  /* Pushed to the far edge — signing out sits next to Save, and the two should
     not be easy to confuse or mis-tap. */
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid #fecaca;
  border-radius: 12px;
  background: #fff;
  color: #b91c1c;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.logout-btn:hover {
  background: #fef2f2;
  border-color: #fca5a5;
}

.logout-btn__icon {
  display: inline-flex;
  align-items: center;
}

@media (max-width: 640px) {
  /* Stacked and full width, so both are comfortable tap targets on a phone. */
  .form-actions {
    flex-wrap: wrap;
  }

  .form-actions .primary-btn,
  .logout-btn {
    flex: 1 1 100%;
    margin-left: 0;
    justify-content: center;
    padding-top: 12px;
    padding-bottom: 12px;
  }
}

.page-header.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.notice.success {
  margin: 12px 0;
  padding: 12px 14px;
  border: 1px solid #bbf7d0;
  background: #dcfce7;
  color: #166534;
  border-radius: 10px;
}

.bulk-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px 0 0 12px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
  min-height: 280px;
}

.bulk-card::before,
.bulk-card::after {
  content: "";
  position: absolute;
}

.bulk-card::after {
  display: none;
}

.bulk-drawer {
  position: fixed;
  top: 299px;
  left: 280px;
  width: 235px;
  z-index: 0;
  transform: translateX(0);
  transition: transform 0.25s ease;
}

.bulk-drawer.is-open {
  transform: translateX(calc(-100% + 2px));
}

.bulk-tab {
  position: absolute;
  left: -29px;
  top: 50%;
  transform: translateY(-50%);
  height: 210px;
  padding: 8px 6px;
  border: 1px solid #e5e7eb;
  border-right: none;
  border-radius: 12px 0 0 12px;
  background: #fff;
  color: #1f2933;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
  writing-mode: vertical-rl;
  text-orientation: upright;
  letter-spacing: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toast-stack {
  position: fixed;
  top: 70px;
  right: 21px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 9999;
}

.toast {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  box-shadow: 0 15px 40px rgba(15, 23, 42, 0.18);
  transform: translate(140%, 0);
  opacity: 0;
  transition: transform 0.35s ease, opacity 0.35s ease;
}

.toast.is-visible {
  transform: translate(0, 0);
  opacity: 1;
}

.toast__icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
}

.toast__body {
  font-size: 14px;
  font-weight: 600;
  color: #0f172a;
}

.toast__close {
  border: none;
  background: transparent;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  color: #475569;
}

.toast--success .toast__icon {
  background: #dcfce7;
  color: #166534;
}

.toast--error {
  border-color: #fecdd3;
}

.toast--error .toast__icon {
  background: #ffe4e6;
  color: #be123c;
}

.toast--info .toast__icon {
  background: #e0f2fe;
  color: #0ea5e9;
}

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

.dash-main {
  padding: 24px 20px 10px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.dash-topbar {
  display: flex;
  align-items: center;
  gap: 14px;
}

.search-wrap {
  flex: 1;
  position: relative;
  z-index: 18;
}

.search-wrap input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 14px;
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.search-wrap {
  margin-right: 0;
}

.search-wrap input:focus {
  outline: none;
  border-color: rgba(21, 16, 103, 0.32);
  box-shadow: 0 0 0 4px rgba(21, 16, 103, 0.12);
}

.dashboard-search-suggest-list {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 40;
  background: linear-gradient(180deg, #ffffff 0%, #fbfcff 100%);
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 16px;
  box-shadow: 0 22px 50px rgba(15, 23, 42, 0.16);
  backdrop-filter: blur(8px);
  max-height: 340px;
  overflow: auto;
  padding: 8px;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.14s ease, transform 0.14s ease;
}

.dashboard-search-suggest-list.is-open {
  opacity: 1;
  transform: translateY(0);
}

.dashboard-search-suggest-item {
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 12px 14px;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  position: relative;
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.dashboard-search-suggest-item__head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.dashboard-search-suggest-item:not(:last-child) {
  margin-bottom: 4px;
}

.dashboard-search-suggest-item strong {
  font-size: 14px;
  line-height: 1.4;
  color: #0f172a;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.dashboard-search-suggest-item span {
  font-size: 12px;
  line-height: 1.35;
  color: #64748b;
}

.dashboard-search-suggest-kind {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  border: 1px solid transparent;
  white-space: nowrap;
}

.dashboard-search-suggest-kind--customer {
  background: rgba(59, 130, 246, 0.1);
  color: #1d4ed8;
  border-color: rgba(59, 130, 246, 0.18);
}

.dashboard-search-suggest-kind--parcel {
  background: rgba(21, 16, 103, 0.08);
  color: var(--primary);
  border-color: rgba(21, 16, 103, 0.16);
}

.dashboard-search-suggest-kind--invoice {
  background: rgba(14, 165, 233, 0.1);
  color: #0369a1;
  border-color: rgba(14, 165, 233, 0.18);
}

.dashboard-search-suggest-item:hover,
.dashboard-search-suggest-item.is-active {
  background: linear-gradient(90deg, rgba(21, 16, 103, 0.08), rgba(21, 16, 103, 0.025));
  box-shadow: inset 0 0 0 1px rgba(21, 16, 103, 0.08);
  transform: translateX(1px);
}

.dashboard-search-suggest-item:hover::before,
.dashboard-search-suggest-item.is-active::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 999px;
  background: var(--primary);
}

.dashboard-search-suggest-item:hover strong,
.dashboard-search-suggest-item.is-active strong {
  color: var(--primary);
}

.dashboard-search-suggest-empty {
  padding: 14px 12px;
  color: #94a3b8;
  font-size: 13px;
  text-align: center;
  border-radius: 12px;
  background: #f8fafc;
}

.dashboard-search-suggest-item mark {
  padding: 0 4px;
  border-radius: 5px;
  background: rgba(21, 16, 103, 0.12);
  color: var(--primary);
  font-weight: 700;
}

.dashboard-search-suggest-list::-webkit-scrollbar {
  width: 10px;
}

.dashboard-search-suggest-list::-webkit-scrollbar-track {
  background: transparent;
}

.dashboard-search-suggest-list::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.45);
  border: 3px solid transparent;
  background-clip: padding-box;
  border-radius: 999px;
}

.search-page {
  padding-bottom: 40px;
}

.search-page__hero {
  padding: 24px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
}

.search-page__hero-copy {
  flex: 1;
  min-width: 0;
}

.search-page__eyebrow {
  margin: 0 0 6px;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.search-page__title {
  margin: 0;
  font-size: clamp(28px, 3vw, 40px);
  line-height: 1.1;
  letter-spacing: -0.04em;
  color: #0f172a;
}

.search-page__query {
  margin: 8px 0 0;
  color: #475569;
  font-size: 15px;
}

.search-form--global {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: min(100%, 420px);
}

.search-form--global input[type="search"] {
  width: 100%;
  min-width: 220px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 14px;
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.search-form--global input[type="search"]:focus {
  outline: none;
  border-color: rgba(21, 16, 103, 0.32);
  box-shadow: 0 0 0 4px rgba(21, 16, 103, 0.12);
}

.search-section+.search-section {
  margin-top: 28px;
}

.search-section__title {
  margin: 0 0 12px;
  font-size: 18px;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: #0f172a;
}

.search-results-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.search-result-card {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.search-result-card__meta {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #64748b;
}

.search-result-card__title {
  margin: 0;
  font-size: 18px;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.search-result-card__customer {
  font-weight: 700;
  color: #111827;
}

.search-result-card__excerpt {
  color: #475569;
  line-height: 1.5;
}

.search-empty-card {
  padding: 18px 20px;
  color: #64748b;
}

@media (max-width: 900px) {
  .search-page__hero {
    flex-direction: column;
    align-items: stretch;
  }

  .search-form--global {
    min-width: 0;
    width: 100%;
  }
}

.bulk-bar .ghost-pill {
  text-align: left;
  width: 100%;
}

.ghost-btn,
.ghost-pill {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  padding: 10px 12px;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

.ghost-btn:hover,
.ghost-pill:hover {
  background: #f3f4f6;
}

.proof-actions .ghost-pill:hover {
  background: #e6ebff;
  border-color: var(--primary);
  color: var(--primary);
}

.proof-file-btn[hidden] {
  display: none !important;
}

.add-inner-card {
  width: 100%;
  justify-content: center;
}

.proof-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.proof-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.proof-buttons {
  display: flex;
  gap: 8px;
  align-items: center;
}

.proof-row-inline {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.proof-slots {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.proof-slot {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.proof-input {
  height: 38px;
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
}

.proof-dropzone {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
  min-height: 38px;
  cursor: pointer;
  background: #f8fafc;
  color: #475569;
}

.proof-dropzone__text {
  font-size: 14px;
}

.invalid {
  border: 1px solid #ef4444 !important;
  box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.25);
}

.ghost-pill.active {
  color: var(--primary);
  border-color: var(--primary);
}

.invoice-check[aria-disabled="true"] {
  opacity: 0.55;
}

.primary-btn {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 10px 14px;
  border-radius: 12px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 30px var(--primary-shadow);
  transition: background 0.15s ease, transform 0.1s ease;
}

.primary-btn:hover {
  background: #32c591;
}

.primary-btn:active {
  transform: translateY(1px);
}

.invoice-pay-btn {
  background: #16a34a;
  box-shadow: 0 10px 30px rgba(22, 163, 74, 0.24);
}

.invoice-pay-btn:hover {
  background: #15803d;
}

.cta-pulse {
  animation: pulse-btn 0.9s ease-in-out 3;
}

@keyframes pulse-btn {
  0% {
    transform: translateY(0) scale(1);
    box-shadow: 0 10px 30px var(--primary-shadow);
  }

  50% {
    transform: translateY(-1px) scale(1.03);
    box-shadow: 0 14px 34px rgba(50, 197, 145, 0.35);
  }

  100% {
    transform: translateY(0) scale(1);
    box-shadow: 0 10px 30px var(--primary-shadow);
  }
}

.muted {
  color: #6b7280;
}

.dash-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.dash-metrics a {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.dash-metrics a.metric {
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.dash-metrics a.metric:hover {
  transform: translateY(-1px);
}

.metric {
  padding: 7px 14px;
  border-radius: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #0f172a;
}

.metric .pill {
  padding: 4px 8px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.08);
  font-weight: 700;
}

.metric.blue {
  background: #e6ecff;
}

.metric.amber {
  background: #fff3e0;
}

.metric.pink {
  background: #fce7f3;
}

.metric.green {
  background: #e4f5ec;
}

.metric.active {
  outline: 2px solid rgb(251, 93, 30);
  box-shadow: 0 0 0 3px rgba(251, 93, 30, 0.18);
}

.accordion-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(17, 24, 39, 0.06);
}

.accordion-header {
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  font-weight: 700;
}

.accordion-body {
  padding: 10px 14px 14px;
  display: none;
}

.accordion-body.active {
  display: block;
}

.accordion-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dash-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 10px;
  padding: 8px 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.chip .pill {
  background: #f3f4f6;
  padding: 2px 6px;
  border-radius: 8px;
}

.chip.active {
  border-color: var(--primary);
  color: var(--primary);
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(17, 24, 39, 0.05);
  width: 100%;
}

.card.profile-meta-card {
  max-width: none;
}

.pickup-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}

.pickup-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  height: 100%;
  max-width: 33%;
}

.pickup-card__title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pickup-card__title .flag {
  font-size: 24px;
}

.pickup-card__body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  color: #1f2937;
}

.copy-line {
  position: relative;
  padding-right: 18px;
  cursor: pointer;
}

.copy-line::after {
  content: '⧉';
  position: absolute;
  right: 2px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  opacity: 0.4;
}

.copy-line:hover::after {
  opacity: 0.8;
}

.pickup-card__note {
  font-size: 14px;
  font-weight: 700;
  color: #475569;
  padding: 6px 0;
  margin-top: auto;
}

.parcel-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
  align-items: stretch;
}

.add-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 2px dashed #e5e7eb;
  background: #f8fafc;
  color: #475569;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, transform 0.12s ease;
  min-height: 360px;
  width: 100%;
  gap: 4px;
  text-align: center;
  padding: 20px;
}

.add-card:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-1px);
}

.add-card__plus {
  font-size: 26px;
  font-weight: 700;
  line-height: 1;
}

.add-card__label {
  font-size: 14px;
  line-height: 1.3;
  font-weight: 600;
  color: inherit;
  max-width: 160px;
  margin-top: -2px;
}

.dash-table {
  overflow: hidden;
  position: relative;
}

.table-head,
.table-row {
  display: grid;
  grid-template-columns: 1fr 1.5fr 1fr 2.6fr 1.2fr 1.1fr;
  align-items: center;
  gap: 10px;
  min-height: 64px;
}

.table-head {
  padding: 14px 16px;
  background: #f8fafc;
  font-weight: 700;
  color: #475569;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.table-body .table-row {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.table-row.is-clickable {
  cursor: pointer;
}

.table-row.is-open {
  background: #f8fafc;
}

.table-head input[type="checkbox"],
.table-row input[type="checkbox"] {
  position: relative;
  top: 1px;
  margin: 0;
}

.table-body .table-row:last-child {
  border-bottom: none;
}

#invoice-list .table-row {
  background-color: #ececec;
}

#invoice-list .table-row.is-paid {
  background-color: #c4df93;
}

#invoice-list .table-row.is-paid:hover {
  background-color: #94bd48;
}

#invoice-list .table-row.is-unpaid {
  background-color: #ececec;
}

#invoice-list .table-row.is-merged {
  background-color: #ececec;
}

.hl {
  background: #fde68a;
  padding: 0 2px;
  border-radius: 3px;
}

.cell.shop {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}

.shop-icon {
  width: 28px;
  height: 28px;
  background: #eef2ff;
  border-radius: 8px;
  display: grid;
  place-items: center;
}

.badge {
  padding: 6px 10px;
  border-radius: 10px;
  font-weight: 700;
}

.badge.blue {
  background: #e6ecff;
  color: #1d4ed8;
}

.badge.amber {
  background: #fff3e0;
  color: #c05621;
}

.badge.green {
  background: #e4f5ec;
  color: #15803d;
}

.dash-detail {
  padding: 16px;
}

.detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.detail-title {
  display: flex;
  gap: 10px;
  align-items: center;
}

.detail-title .muted {
  color: var(--muted);
  font-size: 14px;
}

.detail-actions {
  display: flex;
  gap: 8px;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 16px;
  margin-top: 14px;
}

.parcel-card {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.box-illus {
  width: 120px;
  height: 90px;
  background: linear-gradient(135deg, #f8e7c2, #e6c58b);
  border-radius: 10px;
}

.meta {
  list-style: none;
  margin: 0;
  padding: 0;
  color: var(--text);
  line-height: 1.6;
}

.detail-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tracker {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.tracker-row {
  padding: 8px 0;
  border-bottom: 1px dashed #e5e7eb;
  color: var(--text);
}

.tracker-row:last-child {
  border-bottom: none;
}

.tracker-row.done::before,
.tracker-row.pending::before,
.tracker-row.muted::before {
  content: '';
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 8px;
  position: relative;
  top: -1px;
}

.tracker-row.done::before {
  background: #16a34a;
}

.tracker-row.pending::before {
  background: #f59e0b;
}

.tracker-row.muted {
  color: var(--muted);
}

.tracker-row.muted::before {
  background: #d1d5db;
}

.pager {
  display: flex;
  gap: 6px;
  /* margin-top: -6px; */
}

.pager .ghost-pill[disabled] {
  opacity: 0.5;
  cursor: default;
}

.pager .ghost-pill.disabled {
  opacity: 0.5;
  pointer-events: none;
}

@media (max-width: 1024px) {
  .dash-shell {
    grid-template-columns: 1fr;
  }

  .dash-sidebar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .dash-nav {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .dash-main {
    padding: 24px 20px 10px;
  }

  .profile-card {
    position: static;
    width: auto;
    margin-top: auto;
    box-shadow: none;
  }

  .table-head,
  .table-row {
    grid-template-columns: 100px 1fr 100px 120px 120px 120px;
  }

  .dashboard-grid--user {
    grid-template-columns: 100px 0.225fr 0.8fr 120px 80px 80px 160px 120px;
  }

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

@media (max-width: 640px) {
  .dash-sidebar {
    padding: 10px 12px;
    gap: 8px;
    flex-wrap: wrap;
    height: auto;
    position: static;
  }

  .logo-block {
    flex: 0 0 auto;
  }

  .logo-img {
    height: 36px;
  }

  .dash-nav {
    gap: 4px;
    flex: 1 1 auto;
  }

  .nav-item {
    padding: 7px 9px;
    font-size: 13px;
    gap: 6px;
  }

  .nav-item .icon {
    width: 16px;
  }

  .profile-wrapper {
    margin-top: 0;
    margin-left: auto;
    padding-top: 0;
  }

  .profile-card {
    padding: 7px 10px;
    gap: 7px;
  }

  .profile-meta__line {
    font-size: 12px;
  }

  .profile-meta__line.id-pill {
    font-size: 11px;
    padding: 3px 7px;
  }

  .profile-menu {
    bottom: calc(100% + 4px);
    left: auto;
    right: 0;
    min-width: 180px;
  }

  .dash-main {
    padding: 14px 10px 10px;
  }

  .dash-topbar {
    flex-wrap: wrap;
    gap: 10px;
  }

  .search-wrap {
    flex: 1 1 100%;
  }
}

/* ── Mobile global layout override (≤ 768px) ── */
/* .mobile-hero-banner and .mobile-bell are hidden by default on desktop */
.mobile-hero-banner { display: none; }
.mobile-bell { display: none; }
.mobile-order-eta { display: none; }

@media (max-width: 768px) {
    .dash-shell {
        grid-template-columns: 1fr;
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }

    .dash-main {
        padding: 0 !important;
        min-width: 0;
        max-width: 100%;
        overflow-x: hidden;
    }

    /* Footer: remove left padding (sidebar gone) */
    .site-footer {
        padding-left: 0;
        padding-bottom: 72px;
    }

    /* The shared drawer trigger is fixed above every new-theme page. */
    .dash-main {
        padding: 64px 12px 18px !important;
    }

    body.has-mobile-topbar-menu .dash-main {
        padding: 0 !important;
    }

    .pickup-card {
        max-width: none;
    }

    .add-card {
        min-height: 128px;
        padding: 16px;
    }

}

/* ── Loyalty widget in profile-card ─────────────────────────────────── */
.loyalty-widget {
    margin-top: 6px;
    font-size: 12px;
    line-height: 1.4;
}

.loyalty-widget__badge {
    display: block;
    font-weight: 600;
    color: #888;
    font-size: 11px;
    letter-spacing: 0.02em;
    white-space: nowrap;
    margin-bottom: 7px;
}

.loyalty-widget__badge--active {
    color: var(--primary);
}

.loyalty-widget__bar-wrap {
    position: relative;
    cursor: default;
}

.loyalty-widget__bar-track {
    height: 6px;
    background: rgba(21, 16, 103, 0.12);
    border-radius: 99px;
    overflow: hidden;
}

.loyalty-widget__bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #5b56c4);
    border-radius: 99px;
    transition: width 0.4s ease;
    min-width: 4px;
}

.loyalty-widget__tooltip {
    display: none;
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(21, 16, 103, 0.92);
    color: #fff;
    font-size: 11px;
    white-space: nowrap;
    padding: 4px 9px;
    border-radius: 6px;
    pointer-events: none;
    z-index: 20;
    box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}

.loyalty-widget__tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: rgba(21, 16, 103, 0.92);
}

.loyalty-widget__bar-wrap:hover .loyalty-widget__tooltip {
    display: block;
}

@media (prefers-color-scheme: dark) {
    .loyalty-widget__bar-track {
        background: rgba(255, 255, 255, 0.12);
    }
    .loyalty-widget__badge--active {
        color: #9490e0;
    }
    .loyalty-widget__tooltip {
        background: rgba(90, 86, 196, 0.95);
    }
    .loyalty-widget__tooltip::after {
        border-top-color: rgba(90, 86, 196, 0.95);
    }
}

/* ── Loyalty card on /mano-paskyra/ ─────────────────────────────────── */
.loyalty-card {
    margin-bottom: 20px;
    max-width: 480px;
}

.loyalty-card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.loyalty-card__title {
    font-size: 15px;
    font-weight: 700;
    color: var(--primary);
}

.loyalty-card__balance-pill {
    font-size: 13px;
    color: #555;
}

.loyalty-card__balance-pill strong {
    color: var(--primary);
    font-weight: 700;
}

.loyalty-card__status {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.loyalty-card__level-badge {
    font-size: 13px;
    font-weight: 600;
    color: #888;
}

.loyalty-card__level-badge.is-active {
    color: var(--primary);
}

.loyalty-card__pct-badge {
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    background: var(--primary);
    border-radius: 99px;
    padding: 2px 10px;
}

.loyalty-card__bar-area {
    margin-bottom: 18px;
}

.loyalty-card__bar-track {
    height: 8px;
    background: rgba(21, 16, 103, 0.12);
    border-radius: 99px;
    overflow: hidden;
    margin-bottom: 6px;
}

.loyalty-card__bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #5b56c4);
    border-radius: 99px;
    transition: width 0.4s ease;
    min-width: 6px;
}

.loyalty-card__bar-info {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: #888;
}

.loyalty-card__head-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.loyalty-card__help-btn {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1.5px solid rgba(21, 16, 103, 0.35);
    background: transparent;
    color: var(--primary);
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s;
}

.loyalty-card__help-btn:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* ── Loyalty modal ───────────────────────────────────────────────────── */
.loyalty-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.loyalty-modal[hidden] {
    display: none;
}

.loyalty-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
}

.loyalty-modal__box {
    position: relative;
    background: #fff;
    border-radius: 16px;
    padding: 28px 24px 24px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.18);
    max-height: 90vh;
    overflow-y: auto;
}

.loyalty-modal__close {
    position: absolute;
    top: 14px;
    right: 16px;
    background: none;
    border: none;
    font-size: 16px;
    color: #aaa;
    cursor: pointer;
    line-height: 1;
    padding: 4px;
}

.loyalty-modal__close:hover { color: #333; }

.loyalty-modal__title {
    font-size: 17px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 12px;
    padding-right: 24px;
}

.loyalty-modal__desc {
    font-size: 13px;
    color: #555;
    line-height: 1.6;
    margin: 0 0 18px;
}

.loyalty-modal__levels-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #aaa;
    margin-bottom: 8px;
}

.loyalty-modal__levels {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 18px;
}

.loyalty-modal__level-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 10px;
    border-radius: 8px;
    font-size: 13px;
    color: #bbb;
}

.loyalty-modal__level-row.is-reached { color: #555; }

.loyalty-modal__level-row.is-current {
    background: rgba(21, 16, 103, 0.07);
    color: var(--primary);
    font-weight: 600;
}

.loyalty-modal__row-icon { width: 18px; text-align: center; flex-shrink: 0; font-size: 12px; }
.loyalty-modal__row-label { flex: 1; }
.loyalty-modal__row-kg { font-size: 11px; opacity: 0.7; white-space: nowrap; }
.loyalty-modal__row-pct { font-size: 12px; font-weight: 700; white-space: nowrap; min-width: 28px; text-align: right; }

.loyalty-modal__footer {
    font-size: 12px;
    color: #888;
    margin: 0;
    line-height: 1.5;
    border-top: 1px solid rgba(0,0,0,0.07);
    padding-top: 14px;
}

@media (prefers-color-scheme: dark) {
    .loyalty-card__balance-pill { color: #aaa; }
    .loyalty-card__balance-pill strong { color: #9490e0; }
    .loyalty-card__title { color: #9490e0; }
    .loyalty-card__pct-badge { background: #5b56c4; }
    .loyalty-card__bar-track { background: rgba(255,255,255,0.12); }
    .loyalty-card__level-badge.is-active { color: #9490e0; }
    .loyalty-card__help-btn { border-color: rgba(148,144,224,0.5); color: #9490e0; }
    .loyalty-card__help-btn:hover { background: #5b56c4; border-color: #5b56c4; color: #fff; }
    .loyalty-modal__box { background: #1e1e2e; color: #e0e0f0; }
    .loyalty-modal__title { color: #9490e0; }
    .loyalty-modal__desc { color: #aaa; }
    .loyalty-modal__footer { color: #777; border-top-color: rgba(255,255,255,0.08); }
    .loyalty-modal__level-row.is-current { background: rgba(148,144,224,0.12); color: #9490e0; }
    .loyalty-modal__level-row.is-reached { color: #ccc; }
}
