:root {
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --blue-soft: #eff6ff;
  --blue-line: #dbeafe;
  --navy: #0f172a;
  --navy-2: #1e293b;
  --bg: #f5f7fb;
  --surface: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --muted-2: #94a3b8;
  --line: #e6ebf3;
  --green: #16a34a;
  --green-soft: #ecfdf3;
  --amber: #b45309;
  --amber-soft: #fffbeb;
  --red: #dc2626;
  --red-soft: #fef2f2;
  --violet: #7c3aed;
  --violet-soft: #f5f3ff;
  --teal: #0d9488;
  --teal-soft: #f0fdfa;
  --radius: 20px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 24px 60px rgba(15, 23, 42, 0.18);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --font: "Inter", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  touch-action: pan-x pan-y;
}

body.no-scroll {
  overflow: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

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

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

img,
svg {
  display: block;
}

::selection {
  background: #bfdbfe;
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 999px;
}

.icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.icon-sm {
  width: 16px;
  height: 16px;
}

.icon-lg {
  width: 24px;
  height: 24px;
}

.mono {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  letter-spacing: -0.02em;
}

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

.text-green {
  color: var(--green);
}

.text-red {
  color: var(--red);
}

.text-blue {
  color: var(--blue);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* ---------------------------------- Auth ---------------------------------- */

.auth-page {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(900px 500px at 100% -10%, rgba(37, 99, 235, 0.12), transparent 65%),
    var(--bg);
}

.auth-mobile-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 22px 6px;
}

.auth-panel {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 22px 18px 44px;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 26px;
  box-shadow: var(--shadow);
  padding: 26px 22px;
}

.auth-card h1 {
  font-size: 25px;
  line-height: 1.2;
  letter-spacing: -0.035em;
  margin-bottom: 6px;
}

.auth-card .auth-sub {
  color: var(--muted);
  font-size: 13.5px;
  margin-bottom: 22px;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: #f1f5f9;
  border-radius: 13px;
  padding: 4px;
  margin-bottom: 20px;
}

.auth-tabs a {
  text-align: center;
  padding: 9px 8px;
  border-radius: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.auth-tabs a.active {
  background: #fff;
  color: var(--text);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

.auth-form {
  display: grid;
  gap: 14px;
}

.auth-error {
  display: none;
  background: var(--red-soft);
  color: #b91c1c;
  border: 1px solid #fecaca;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 12.5px;
  font-weight: 600;
}

.auth-error.show {
  display: block;
}

.auth-demo {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px dashed var(--line);
}

.auth-demo-title {
  font-size: 11px;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted-2);
  margin-bottom: 10px;
}

.demo-grid {
  display: grid;
  gap: 8px;
}

.demo-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 12px;
  text-align: left;
  font-size: 12.5px;
  transition: 0.18s ease;
}

.demo-btn:hover {
  border-color: #bfdbfe;
  background: var(--blue-soft);
}

.demo-btn strong {
  display: block;
  font-size: 12.5px;
}

.demo-btn span {
  color: var(--muted);
  font-size: 11.5px;
}

.auth-brand {
  display: none;
}

@media (min-width: 980px) {
  .auth-page {
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    background: #fff;
  }

  .auth-mobile-brand {
    display: none;
  }

  .auth-brand {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    padding: 48px 54px;
    background:
      radial-gradient(800px 500px at 20% 110%, rgba(96, 165, 250, 0.45), transparent 60%),
      linear-gradient(145deg, #0f172a 0%, #14245a 45%, #1d4ed8 100%);
    color: #fff;
  }

  .auth-brand::before,
  .auth-brand::after {
    content: "";
    position: absolute;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    pointer-events: none;
  }

  .auth-brand::before {
    width: 520px;
    height: 520px;
    right: -220px;
    top: -160px;
  }

  .auth-brand::after {
    width: 360px;
    height: 360px;
    right: -120px;
    top: -80px;
    background: rgba(255, 255, 255, 0.035);
  }

  .auth-brand .brand {
    position: relative;
    z-index: 1;
  }

  .auth-brand .brand-name strong,
  .auth-brand .brand-name span {
    color: #fff;
  }

  .auth-brand .brand-name span {
    color: rgba(255, 255, 255, 0.6);
  }

  .auth-hero {
    position: relative;
    z-index: 1;
    max-width: 470px;
    margin: 30px 0;
  }

  .auth-hero .eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 11px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.12);
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 18px;
  }

  .auth-hero h2 {
    font-size: clamp(32px, 3.3vw, 46px);
    line-height: 1.08;
    letter-spacing: -0.045em;
    margin-bottom: 18px;
  }

  .auth-hero h2 em {
    color: #93c5fd;
    font-style: normal;
  }

  .auth-hero p {
    color: rgba(255, 255, 255, 0.66);
    font-size: 15px;
    max-width: 420px;
  }

  .auth-features {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 10px;
  }

  .auth-feature {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.055);
    border: 1px solid rgba(255, 255, 255, 0.08);
    max-width: 390px;
  }

  .auth-feature .feature-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: rgba(147, 197, 253, 0.16);
    color: #bfdbfe;
    flex-shrink: 0;
  }

  .auth-feature strong {
    display: block;
    font-size: 12.5px;
    margin-bottom: 1px;
  }

  .auth-feature span {
    color: rgba(255, 255, 255, 0.55);
    font-size: 11.5px;
  }

  .auth-brand-foot {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.4);
    font-size: 11.5px;
  }

  .auth-panel {
    align-items: center;
    padding: 40px;
    background: #fff;
  }

  .auth-card {
    border: 0;
    box-shadow: none;
    padding: 0;
    max-width: 400px;
  }

  .auth-card h1 {
    font-size: 30px;
  }
}

/* --------------------------------- Shell ---------------------------------- */

.app-shell {
  min-height: 100dvh;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 264px;
  z-index: 50;
  display: none;
  flex-direction: column;
  padding: 22px 16px;
  background: var(--surface);
  border-right: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 8px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(145deg, var(--blue-light, #3b82f6), var(--blue-dark, #1d4ed8));
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.28);
  flex-shrink: 0;
}

.brand-mark.has-logo {
  background: #fff;
  box-shadow: 0 0 0 1px var(--line), 0 6px 14px rgba(15, 23, 42, 0.08);
  padding: 3px;
}

.brand-mark.has-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 10px;
}

.brand-mark svg {
  width: 23px;
  height: 23px;
}

.brand-name {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-name strong {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.brand-name span {
  font-size: 10.5px;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.sidebar-nav {
  flex: 1;
  margin-top: 30px;
  overflow-y: auto;
}

.nav-label {
  padding: 0 12px;
  margin: 18px 0 8px;
  color: var(--muted-2);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.nav-label:first-child {
  margin-top: 0;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: 12px;
  color: #475569;
  font-size: 13.5px;
  font-weight: 600;
  margin-bottom: 2px;
  transition: 0.18s ease;
}

.nav-item .nav-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: #64748b;
  transition: 0.18s ease;
}

.nav-item:hover {
  background: #f8fafc;
  color: var(--text);
}

.nav-item.active {
  background: var(--blue-soft);
  color: var(--blue-dark);
}

.nav-item.active .nav-icon {
  background: #fff;
  color: var(--blue);
  box-shadow: 0 3px 10px rgba(37, 99, 235, 0.14);
}

.nav-item .nav-badge {
  margin-left: auto;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  display: grid;
  place-items: center;
}

.sidebar-user {
  margin-top: 16px;
  padding: 12px;
  border-radius: 14px;
  background: #f8fafc;
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-user .person-info {
  flex: 1;
  min-width: 0;
}

.sidebar-user strong {
  display: block;
  font-size: 12.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user span {
  display: block;
  font-size: 10.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-main {
  min-height: 100dvh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(245, 247, 251, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(230, 235, 243, 0.7);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 16px;
  max-width: 1600px;
  margin: 0 auto;
}

.topbar-brand-mobile {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.topbar-brand-mobile .brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 11px;
}

.topbar-brand-mobile .brand-mark svg {
  width: 20px;
  height: 20px;
}

.topbar-titles {
  min-width: 0;
}

.topbar-titles h1 {
  font-size: 16.5px;
  font-weight: 800;
  letter-spacing: -0.025em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-titles p {
  display: none;
  color: var(--muted);
  font-size: 11.5px;
  margin-top: 1px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
}

.icon-btn {
  position: relative;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: #475569;
  transition: 0.18s ease;
}

.icon-btn:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
  color: var(--text);
}

.icon-btn .count-dot {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--blue);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  display: grid;
  place-items: center;
  border: 2px solid var(--bg);
}

.topbar-avatar {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #dbeafe, #bfdbfe);
  color: var(--blue-dark);
  font-weight: 800;
  font-size: 13px;
  border: 1px solid #bfdbfe;
}

.view {
  max-width: 1600px;
  min-width: 0;
  margin: 0 auto;
  padding: 18px 16px calc(94px + var(--safe-bottom));
  overflow-x: clip;
}

.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 2px;
  padding: 7px 6px calc(7px + var(--safe-bottom));
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-top: 1px solid var(--line);
}

.bottom-nav-simple {
  display: flex;
  justify-content: space-around;
}

.bnav-group {
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: 2px;
  min-width: 0;
}

.bnav-home {
  width: 58px;
  max-width: 58px;
}

.bnav-item {
  flex: 1;
  min-width: 0;
  max-width: 92px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 5px 2px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 650;
  letter-spacing: 0.01em;
  transition: 0.18s ease;
}

.bnav-item > span:last-child {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bnav-icon {
  width: 34px;
  height: 28px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  transition: 0.18s ease;
}

.bnav-item.active {
  color: var(--blue-dark);
}

.bnav-item.active .bnav-icon {
  background: var(--blue-soft);
  color: var(--blue);
}

.bnav-item .icon {
  width: 19px;
  height: 19px;
}

.mobile-menu {
  display: grid;
  gap: 8px;
}

.mobile-menu-item {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 54px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: #475569;
  font-size: 13.5px;
  font-weight: 650;
  transition: 0.18s ease;
}

.mobile-menu-item > span:nth-child(2) {
  flex: 1;
}

.mobile-menu-item > .icon:last-child {
  width: 17px;
  height: 17px;
  color: var(--muted-2);
}

.mobile-menu-item:hover {
  background: #f8fafc;
  color: var(--text);
}

.mobile-menu-item.active {
  background: var(--blue-soft);
  border-color: #bfdbfe;
  color: var(--blue-dark);
}

.mobile-menu-icon {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: #f1f5f9;
  color: var(--muted);
  flex-shrink: 0;
}

.mobile-menu-item.active .mobile-menu-icon {
  background: #fff;
  color: var(--blue);
  box-shadow: 0 3px 10px rgba(37, 99, 235, 0.14);
}

@media (min-width: 1024px) {
  .sidebar {
    display: flex;
  }

  .app-main {
    margin-left: 264px;
  }

  .bottom-nav {
    display: none;
  }

  .topbar-inner {
    padding: 15px 32px;
  }

  .topbar-titles h1 {
    font-size: 20px;
  }

  .topbar-titles p {
    display: block;
  }

  .view {
    padding: 26px 32px 48px;
  }
}

@media (min-width: 1440px) {
  .sidebar {
    width: 280px;
  }

  .app-main {
    margin-left: 280px;
  }
}

/* -------------------------------- Brand bits ------------------------------ */

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 800;
  color: var(--blue-dark);
  background: var(--blue-soft);
  flex-shrink: 0;
  border: 1px solid var(--blue-line);
}

.avatar.avatar-green {
  background: var(--green-soft);
  color: #15803d;
  border-color: #bbf7d0;
}

.avatar.avatar-amber {
  background: var(--amber-soft);
  color: var(--amber);
  border-color: #fde68a;
}

.avatar.avatar-violet {
  background: var(--violet-soft);
  color: var(--violet);
  border-color: #ddd6fe;
}

/* ---------------------------------- Page ---------------------------------- */

.page {
  animation: pageIn 0.32s ease both;
}

@keyframes pageIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.page-head h2 {
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.2;
}

.page-head p {
  color: var(--muted);
  font-size: 12.5px;
  margin-top: 3px;
}

.page-head .head-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.eyebrow {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.section-title h3 {
  font-size: 14.5px;
  font-weight: 750;
  letter-spacing: -0.02em;
}

.section-title a,
.section-title button {
  font-size: 12px;
  font-weight: 650;
  color: var(--blue);
  background: none;
  border: 0;
  padding: 0;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.card-pad {
  padding: 16px;
}

@media (min-width: 640px) {
  .card-pad {
    padding: 18px;
  }
}

/* --------------------------------- Buttons -------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 42px;
  padding: 0 16px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-size: 13.5px;
  font-weight: 700;
  white-space: nowrap;
  transition: 0.18s ease;
  user-select: none;
}

.btn .icon {
  width: 18px;
  height: 18px;
}

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

.btn:disabled {
  opacity: 0.55;
  pointer-events: none;
}

.btn-primary {
  background: var(--blue);
  color: #fff;
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.24);
}

.btn-primary:hover {
  background: var(--blue-dark);
}

.btn-dark {
  background: var(--navy);
  color: #fff;
}

.btn-dark:hover {
  background: var(--navy-2);
}

.btn-soft {
  background: var(--blue-soft);
  color: var(--blue-dark);
}

.btn-soft:hover {
  background: #dbeafe;
}

.btn-ghost {
  background: var(--surface);
  border-color: var(--line);
  color: #334155;
}

.btn-ghost:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
}

.btn-danger {
  background: var(--red-soft);
  color: #b91c1c;
  border-color: #fecaca;
}

.btn-danger:hover {
  background: #fee2e2;
}

.btn-sm {
  height: 34px;
  padding: 0 11px;
  font-size: 12px;
  border-radius: 10px;
}

.btn-sm .icon {
  width: 15px;
  height: 15px;
}

.btn-icon {
  width: 38px;
  height: 38px;
  padding: 0;
}

.btn-block {
  width: 100%;
}

.btn-link {
  background: none;
  border: 0;
  color: var(--blue);
  font-weight: 650;
  font-size: 12.5px;
  padding: 4px;
}

/* --------------------------------- Badges --------------------------------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 750;
  line-height: 1.2;
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.badge .dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.badge-green {
  background: var(--green-soft);
  color: #15803d;
}

.badge-blue {
  background: var(--blue-soft);
  color: var(--blue-dark);
}

.badge-amber {
  background: var(--amber-soft);
  color: var(--amber);
}

.badge-red {
  background: var(--red-soft);
  color: #b91c1c;
}

.badge-violet {
  background: var(--violet-soft);
  color: var(--violet);
}

.badge-slate {
  background: #f1f5f9;
  color: #475569;
}

.badge-teal {
  background: var(--teal-soft);
  color: var(--teal);
}

.badge-outline {
  background: #fff;
  border: 1px solid var(--line);
  color: var(--muted);
}

/* --------------------------------- Inputs --------------------------------- */

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.field > label {
  font-size: 12px;
  font-weight: 700;
  color: #334155;
}

.field .label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.input,
.select,
.textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 10px 13px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.input::placeholder,
.textarea::placeholder {
  color: #a3afc2;
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: #93c5fd;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.select {
  appearance: none;
  max-width: 100%;
  text-overflow: ellipsis;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  padding-right: 38px;
}

.textarea {
  min-height: 88px;
  resize: vertical;
  line-height: 1.5;
}

.input-sm {
  min-height: 36px;
  padding: 6px 10px;
  font-size: 13px;
}

.select.input-sm {
  padding-right: 32px;
  background-position: right 9px center;
  background-size: 14px;
}

.financial-date-input,
.financial-period {
  width: auto;
}

.financial-period {
  min-width: 88px;
}

.financial-range-sep {
  color: var(--muted);
  font-size: 12px;
}

.financial-new-transaction {
  height: 30px;
  padding: 0 8px;
  font-size: 11px;
}

.financial-new-transaction .icon {
  width: 13px;
  height: 13px;
}

@media (max-width: 1023px) {
  .input,
  .select,
  .textarea,
  input,
  select,
  textarea {
    font-size: 16px;
  }
}

.hint {
  color: var(--muted-2);
  font-size: 11px;
  line-height: 1.4;
}

.form-grid {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.form-grid > * {
  min-width: 0;
}

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

.form-grid .span-2 {
  grid-column: 1 / -1;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

@media (max-width: 560px) {
  .form-actions {
    justify-content: stretch;
  }

  .form-actions .btn {
    flex: 1 1 100%;
    width: 100%;
  }
}

@media (min-width: 560px) {
  .form-grid.cols-2 {
    grid-template-columns: 1fr 1fr;
  }
}

.customer-picker {
  position: relative;
}

.customer-suggestions {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 20;
  max-height: min(240px, 40vh);
  overflow-y: auto;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow-lg);
}

.customer-suggestions[hidden] {
  display: none;
}

.customer-suggestion {
  display: flex;
  flex-direction: column;
  width: 100%;
  gap: 1px;
  padding: 9px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  text-align: left;
}

.customer-suggestion strong {
  font-size: 12.5px;
  font-weight: 700;
}

.customer-suggestion span {
  font-size: 10.5px;
  color: var(--muted);
}

.customer-suggestion:hover,
.customer-suggestion.is-active {
  background: var(--blue-soft);
}

.customer-suggestions-empty {
  padding: 10px;
  color: var(--muted);
  font-size: 11.5px;
  text-align: center;
}

.part-picker {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}

.part-results {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 4px;
  max-height: min(230px, 36vh);
  overflow-y: auto;
}

.part-results[hidden] {
  display: none;
}

.part-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  text-align: left;
}

.part-option-main {
  display: flex;
  flex: 1;
  min-width: 0;
  flex-direction: column;
  gap: 1px;
}

.part-option-main strong {
  font-size: 12.5px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.part-option-main span {
  font-size: 10.5px;
  color: var(--muted);
}

.part-option-price {
  flex-shrink: 0;
  font-size: 11.5px;
  font-weight: 750;
}

.part-option:hover,
.part-option.is-active {
  background: var(--blue-soft);
}

.part-results-empty {
  padding: 10px;
  color: var(--muted);
  font-size: 11.5px;
  text-align: center;
}

.search-box {
  position: relative;
  flex: 1;
  min-width: 0;
}

.search-box .icon {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--muted-2);
  pointer-events: none;
}

.search-box .input {
  padding-left: 40px;
  background: #fff;
}

.toolbar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.toolbar-row {
  display: flex;
  align-items: center;
  gap: 9px;
}

.chip-row {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 2px;
}

.chip-row::-webkit-scrollbar {
  display: none;
}

.chip {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
  transition: 0.16s ease;
}

.chip:hover {
  border-color: #cbd5e1;
  color: var(--text);
}

.chip.active {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}

.chip .chip-count {
  opacity: 0.65;
  margin-left: 3px;
  font-size: 10.5px;
}

@media (min-width: 720px) {
  .toolbar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .toolbar .search-box {
    max-width: 380px;
  }
}

/* -------------------------------- Dashboard ------------------------------- */

.welcome {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.welcome h2 {
  font-size: clamp(22px, 4vw, 28px);
  font-weight: 800;
  letter-spacing: -0.04em;
  margin: 2px 0 3px;
}

.welcome p {
  color: var(--muted);
  font-size: 12.5px;
}

.welcome .desktop-only {
  display: none;
}

.overview-card {
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  padding: 21px;
  background:
    radial-gradient(500px 260px at 105% -20%, rgba(147, 197, 253, 0.5), transparent 65%),
    linear-gradient(120deg, #1d4ed8, #2563eb 60%, #3b82f6);
  color: #fff;
  box-shadow: 0 18px 38px rgba(37, 99, 235, 0.24);
  margin-bottom: 14px;
}

.overview-card::after {
  content: "";
  position: absolute;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  right: -50px;
  bottom: -70px;
}

.overview-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
  font-weight: 650;
  color: rgba(255, 255, 255, 0.72);
  text-transform: uppercase;
  letter-spacing: 0.09em;
}

.overview-amount {
  font-size: clamp(31px, 7vw, 45px);
  font-weight: 800;
  letter-spacing: -0.055em;
  line-height: 1.1;
  margin: 6px 0 9px;
}

.overview-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  position: relative;
  z-index: 1;
}

.overview-meta .growth {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 11px;
  font-weight: 700;
}

.overview-meta span {
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.64);
}

.overview-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  position: relative;
  z-index: 1;
}

.overview-foot .overview-note {
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.62);
}

.overview-foot .btn {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.18);
  color: #fff;
  backdrop-filter: blur(8px);
  height: 38px;
  font-size: 12.5px;
}

.overview-foot .btn:hover {
  background: rgba(255, 255, 255, 0.22);
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
  min-width: 0;
}

.kpi {
  min-width: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 13px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.kpi-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 9px;
  min-width: 0;
}

.kpi-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--blue-soft);
  color: var(--blue);
  flex-shrink: 0;
}

.kpi-icon .icon {
  width: 17px;
  height: 17px;
}

.kpi-icon.green {
  background: var(--green-soft);
  color: var(--green);
}

.kpi-icon.amber {
  background: var(--amber-soft);
  color: var(--amber);
}

.kpi-icon.violet {
  background: var(--violet-soft);
  color: var(--violet);
}

.kpi-icon.red {
  background: var(--red-soft);
  color: var(--red);
}

.kpi-label {
  flex: 1;
  min-width: 0;
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.kpi-value {
  max-width: 100%;
  font-size: clamp(16px, 5vw, 21px);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.1;
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}

.kpi-sub {
  margin-top: 3px;
  font-size: 10.5px;
  color: var(--muted-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Financial KPI centering */
.financial-kpi-grid .kpi-top {
  justify-content: center;
  gap: 8px;
}

.financial-kpi-grid .kpi-label {
  text-align: center;
}

.financial-kpi-grid .kpi-value {
  text-align: center;
}

.financial-kpi-grid .kpi-sub {
  text-align: center;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}

.kpi-grid.financial-kpi-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 699px) {
  .kpi-grid.financial-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 10px;
  }

  .kpi-grid.financial-kpi-grid .kpi {
    padding: 10px 11px;
    border-radius: 14px;
  }

  .kpi-grid.financial-kpi-grid .kpi:last-child {
    grid-column: 1 / -1;
  }

  .financial-kpi-grid .kpi-top {
    justify-content: space-between;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
  }

  .financial-kpi-grid .kpi-label {
    text-align: left;
    font-size: 10.5px;
    line-height: 1.2;
  }

  .financial-kpi-grid .kpi-icon {
    width: 26px;
    height: 26px;
    border-radius: 8px;
  }

  .financial-kpi-grid .kpi-icon .icon {
    width: 14px;
    height: 14px;
  }

  .financial-kpi-grid .kpi-value {
    text-align: left;
    font-size: 18px;
    line-height: 1.15;
  }

  .financial-kpi-grid .kpi-sub {
    margin-top: 1px;
    font-size: 10px;
    text-align: left;
  }

  .kpi-grid.financial-kpi-grid .kpi:last-child .kpi-top::before {
    content: '';
    width: 26px;
    height: 26px;
    flex-shrink: 0;
  }

  .kpi-grid.financial-kpi-grid .kpi:last-child .kpi-label,
  .kpi-grid.financial-kpi-grid .kpi:last-child .kpi-value,
  .kpi-grid.financial-kpi-grid .kpi:last-child .kpi-sub {
    text-align: center;
  }
}

@media (max-width: 359px) {
  .kpi-grid.financial-kpi-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .kpi-grid.financial-kpi-grid .kpi:last-child {
    grid-column: auto;
  }
}

.financial-date-description {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  margin: 12px 0 8px;
  font-weight: 500;
}

/* Financial page head - mobile: actions on right */
.financial-page-head {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-start;
}

.financial-page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  min-width: 0;
  max-width: 100%;
}

.financial-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  min-width: 0;
  max-width: 100%;
}

.financial-dates {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  align-items: center;
  min-width: 0;
  max-width: 100%;
}

#financial-results {
  min-width: 0;
  max-width: 100%;
}

@media (max-width: 699px) {
  .financial-page-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "title button"
      "filters filters";
    align-items: center;
    column-gap: 8px;
    row-gap: 10px;
  }

  .financial-page-head > div:first-child {
    grid-area: title;
    min-width: 0;
  }

  .financial-page-head .financial-page-actions {
    display: contents;
  }

  .financial-filters {
    grid-area: filters;
    width: 100%;
    max-width: 100%;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px;
    min-width: 0;
  }

  .financial-filters .financial-period {
    flex: 0 0 auto;
    min-width: 0;
    padding-left: 8px;
    padding-right: 24px;
    font-size: 13px;
  }

  .financial-dates {
    flex: 1 1 230px;
    justify-content: center;
    gap: 4px;
    min-width: 0;
  }

  .financial-dates .financial-date-input {
    flex: 1 1 0;
    width: 0;
    min-width: 0;
    max-width: 100%;
    padding-left: 6px;
    padding-right: 6px;
    font-size: 13px;
  }

  .financial-range-sep {
    flex: 0 0 auto;
    font-size: 11px;
  }

  .financial-new-transaction {
    grid-area: button;
    justify-self: end;
  }
}

/* Financial KPI active state */
.financial-kpi-grid .kpi.active {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px var(--blue-soft);
}

.financial-kpi-grid .kpi[data-financial-filter] {
  cursor: pointer;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.financial-kpi-grid .kpi[data-financial-filter]:hover {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px var(--blue-soft);
}

.financial-kpi-grid .kpi[data-financial-filter]:focus-visible {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue);
}

.dashboard-grid {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.dashboard-grid > * {
  min-width: 0;
}

.dashboard-grid .stack {
  grid-template-columns: minmax(0, 1fr);
}

.dashboard-grid .stack > * {
  min-width: 0;
  max-width: 100%;
}

.dashboard-side {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  min-width: 0;
}

.dashboard-side > * {
  min-width: 0;
  max-width: 100%;
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  min-width: 0;
}

.quick-action {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px;
  min-width: 0;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  text-align: left;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.25;
  transition: 0.18s ease;
}

.quick-action:hover {
  border-color: #bfdbfe;
  background: #f8fbff;
}

.quick-action .qa-icon {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: var(--blue-soft);
  color: var(--blue);
  flex-shrink: 0;
}

.quick-action .qa-icon .icon {
  width: 16px;
  height: 16px;
}

.quick-action.green .qa-icon {
  background: var(--green-soft);
  color: var(--green);
}

.quick-action.violet .qa-icon {
  background: var(--violet-soft);
  color: var(--violet);
}

.quick-action.amber .qa-icon {
  background: var(--amber-soft);
  color: var(--amber);
}

.chart-card {
  padding: 16px;
  min-width: 0;
}

.chart-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  min-width: 0;
}

.chart-head > div:first-child {
  min-width: 0;
}

.chart-head h3 {
  font-size: 14px;
  font-weight: 750;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}

.chart-head p {
  font-size: 11px;
  color: var(--muted);
  margin-top: 1px;
}

.chart-total {
  text-align: right;
  flex-shrink: 0;
}

.chart-total strong {
  display: block;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.03em;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.chart-total span {
  font-size: 10px;
  color: var(--muted);
}

.chart {
  display: flex;
  align-items: stretch;
  gap: 7px;
  height: 154px;
  padding-top: 14px;
  min-width: 0;
}

.chart-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  justify-content: flex-end;
}

.chart-value {
  max-width: 100%;
  height: 12px;
  font-size: clamp(7px, 2.2vw, 8.5px);
  font-weight: 650;
  letter-spacing: -0.02em;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
}

.chart-bar-wrap {
  width: 100%;
  flex: 1;
  display: flex;
  align-items: flex-end;
  padding: 0 2px;
}

.chart-bar {
  width: 100%;
  min-height: 4px;
  border-radius: 7px 7px 3px 3px;
  background: linear-gradient(180deg, #93c5fd, #3b82f6);
  transition: height 0.4s ease;
}

.chart-bar.today {
  background: linear-gradient(180deg, #60a5fa, #1d4ed8);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.chart-col > span {
  max-width: 100%;
  font-size: clamp(8.5px, 2.7vw, 9.5px);
  font-weight: 650;
  color: var(--muted);
  text-transform: capitalize;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini-list {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.mini-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  min-width: 0;
  border-bottom: 1px solid #f1f5f9;
  cursor: pointer;
}

.mini-item:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.mini-item:first-child {
  padding-top: 0;
}

.mini-item .mini-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: #f8fafc;
  display: grid;
  place-items: center;
  color: var(--muted);
  flex-shrink: 0;
}

.mini-item .mini-icon.warn {
  background: var(--amber-soft);
  color: var(--amber);
}

.mini-item .mini-main {
  flex: 1;
  min-width: 0;
}

.mini-item strong {
  display: block;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini-item span {
  display: block;
  font-size: 10.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini-item .mini-side {
  text-align: right;
  flex-shrink: 0;
  min-width: 0;
  max-width: 46%;
}

.mini-item .mini-side strong {
  font-size: 12px;
}

.mini-item .mini-side span {
  font-size: 9.5px;
}

@media (max-width: 699px) {
  .quick-action {
    gap: 8px;
    padding: 10px;
    font-size: 11.5px;
  }

  .quick-action .qa-icon {
    width: 30px;
    height: 30px;
  }

  .chart {
    gap: 4px;
  }
}

@media (min-width: 700px) {
  .welcome .desktop-only {
    display: inline-flex;
  }

  .overview-card {
    padding: 25px 27px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
  }

  .overview-main {
    min-width: 0;
  }

  .overview-foot {
    margin-top: 0;
    flex-direction: column;
    align-items: flex-end;
    gap: 9px;
  }

  .kpi-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
  }

  .kpi {
    padding: 15px;
  }

  .kpi-value {
    font-size: 24px;
  }

  .kpi-label {
    font-size: 11.5px;
  }

  .quick-actions {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 1180px) {
  .dashboard-grid {
    grid-template-columns: 1.55fr 1fr;
    align-items: start;
  }

  .dashboard-side {
    display: grid;
    gap: 14px;
  }
}

/* -------------------------------- Products -------------------------------- */

.tabbar {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: #eef2f8;
  border-radius: 13px;
  margin-bottom: 16px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.tabbar::-webkit-scrollbar {
  display: none;
}

.tabbar button {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: 10px;
  padding: 9px 10px;
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
  transition: 0.18s ease;
}

.tabbar .tab-label-short {
  display: none;
}

.tabbar button.active {
  background: #fff;
  color: var(--text);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

.tabbar .tab-count {
  background: #e2e8f0;
  color: #475569;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 750;
  padding: 1px 6px;
}

.tabbar button.active .tab-count {
  background: var(--blue-soft);
  color: var(--blue-dark);
}

@media (max-width: 560px) {
  .tabbar {
    gap: 2px;
    padding: 3px;
  }

  .tabbar button {
    gap: 4px;
    padding: 9px 6px;
    font-size: 11.5px;
  }

  .tabbar button > .icon {
    display: none;
  }

  .tabbar .tab-label-long {
    display: none;
  }

  .tabbar .tab-label-short {
    display: inline;
  }

  .tabbar .tab-count {
    font-size: 9px;
    padding: 1px 5px;
  }
}

.product-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.product-card {
  position: relative;
  display: flex;
  gap: 12px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: #fff;
  box-shadow: var(--shadow-sm);
  transition: 0.18s ease;
}

.product-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: #dbe3ef;
}

.thumb {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: var(--blue-soft);
  color: var(--blue);
}

.thumb .icon {
  width: 24px;
  height: 24px;
}

.thumb.device {
  background: linear-gradient(145deg, #dbeafe, #eff6ff);
  color: #1d4ed8;
}

.thumb.part {
  background: var(--violet-soft);
  color: var(--violet);
}

.thumb.accessory {
  background: var(--teal-soft);
  color: var(--teal);
}

.product-main {
  flex: 1;
  min-width: 0;
}

.product-name {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  font-size: 13.5px;
  font-weight: 750;
  line-height: 1.3;
  letter-spacing: -0.015em;
  margin-bottom: 2px;
}

.product-name span {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-meta {
  font-size: 10.5px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  margin-bottom: 7px;
}

.product-meta .sep {
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: #cbd5e1;
}

.product-line {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
}

.price {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.03em;
  white-space: nowrap;
}

.price small {
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  margin-right: 2px;
}

.stock-note {
  font-size: 10px;
  color: var(--muted-2);
  white-space: nowrap;
}

.product-actions {
  display: flex;
  gap: 4px;
  margin-top: 9px;
  padding-top: 9px;
  border-top: 1px dashed #edf1f7;
}

.product-actions .btn {
  flex: 1;
}

@media (min-width: 620px) {
  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1300px) {
  .product-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1700px) {
  .product-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* --------------------------------- Units ---------------------------------- */

.unit-list {
  display: grid;
  gap: 9px;
}

.unit-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.unit-device-icon {
  width: 46px;
  height: 46px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  background: #f8fafc;
  color: #475569;
  flex-shrink: 0;
  border: 1px solid #eef2f7;
}

.unit-main {
  flex: 1;
  min-width: 0;
}

.unit-imei {
  font-size: 11.5px;
  font-weight: 750;
  color: var(--text);
  word-break: break-all;
}

.unit-name {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  margin: 1px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.unit-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  font-size: 10px;
  color: var(--muted);
}

.unit-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}

.unit-price {
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.unit-actions {
  display: flex;
  gap: 6px;
  margin-top: 12px;
}

/* ------------------------------ Record lists ------------------------------ */

.record-list {
  display: grid;
  gap: 9px;
}

.record {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: 0.18s ease;
}

.record:hover {
  border-color: #dbe3ef;
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.record-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--blue-soft);
  color: var(--blue);
  flex-shrink: 0;
}

.record-icon.green {
  background: var(--green-soft);
  color: var(--green);
}

.record-icon.amber {
  background: var(--amber-soft);
  color: var(--amber);
}

.record-icon.violet {
  background: var(--violet-soft);
  color: var(--violet);
}

.record-main {
  flex: 1;
  min-width: 0;
}

.record-title {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 13px;
  font-weight: 750;
  letter-spacing: -0.015em;
}

.record-title .mono {
  font-size: 11.5px;
}

.record-sub {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 10.5px;
  color: var(--muted);
  margin-top: 1px;
}

.record-sub .dot-sep {
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: #cbd5e1;
}

.record-side {
  text-align: right;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
}

.record-amount {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: -0.025em;
}

.record-time {
  font-size: 9.5px;
  color: var(--muted-2);
}

.record .chev {
  color: #cbd5e1;
  flex-shrink: 0;
}

@media (max-width: 420px) {
  .record .chev {
    display: none;
  }

  .record-side .record-time {
    display: none;
  }
}

/* -------------------------------- Customers ------------------------------- */

.person-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.person-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: 0.18s ease;
}

.person-card:hover {
  border-color: #dbe3ef;
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.person-main {
  flex: 1;
  min-width: 0;
}

.person-main strong {
  display: block;
  font-size: 13px;
  font-weight: 750;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.person-main span {
  display: block;
  font-size: 10.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.person-stats {
  display: flex;
  gap: 12px;
  margin-top: 4px;
  font-size: 9.5px;
  color: var(--muted);
}

.person-stats strong {
  color: var(--text);
  font-size: 10.5px;
}

.person-side {
  text-align: right;
  flex-shrink: 0;
}

.person-side strong {
  display: block;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.person-side span {
  font-size: 9px;
  color: var(--muted-2);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

@media (min-width: 700px) {
  .person-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1300px) {
  .person-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* ------------------------------ Catalog/portal ----------------------------- */

.portal-hero {
  position: relative;
  overflow: hidden;
  padding: 22px;
  border-radius: 24px;
  background:
    radial-gradient(420px 260px at 108% -30%, rgba(147, 197, 253, 0.35), transparent 70%),
    linear-gradient(130deg, #0f172a, #172554 55%, #1d4ed8);
  color: #fff;
  margin-bottom: 16px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.22);
}

.portal-hero h2 {
  font-size: clamp(23px, 5vw, 32px);
  letter-spacing: -0.045em;
  line-height: 1.12;
  margin: 5px 0 6px;
  max-width: 460px;
}

.portal-hero p {
  color: rgba(255, 255, 255, 0.62);
  font-size: 12.5px;
  max-width: 420px;
}

.portal-hero .hero-actions {
  display: flex;
  gap: 8px;
  margin-top: 18px;
  flex-wrap: wrap;
}

.portal-hero .btn-light {
  background: #fff;
  color: var(--navy);
}

.portal-hero .btn-glass {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.portal-hero .eyebrow {
  color: #93c5fd;
}

.portal-hero .hero-blob {
  position: absolute;
  right: -42px;
  bottom: -58px;
  width: 210px;
  height: 210px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.14);
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.12);
}

.portal-hero .hero-blob .icon {
  width: 96px;
  height: 96px;
}

.cart-float {
  position: fixed;
  z-index: 55;
  left: 14px;
  right: 14px;
  bottom: calc(78px + var(--safe-bottom));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px 10px 15px;
  border-radius: 16px;
  background: var(--navy);
  color: #fff;
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.32);
  animation: floatIn 0.3s ease both;
}

.cart-float .cart-float-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.cart-float .cart-float-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.12);
}

.cart-float strong {
  display: block;
  font-size: 12.5px;
}

.cart-float span {
  display: block;
  font-size: 10.5px;
  color: rgba(255, 255, 255, 0.62);
}

.cart-float .btn {
  height: 38px;
  background: #fff;
  color: var(--navy);
  font-size: 12px;
}

@keyframes floatIn {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (min-width: 1024px) {
  .cart-float {
    left: auto;
    right: 26px;
    bottom: 24px;
    width: 360px;
  }
}

.cat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.cat-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: #fff;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: 0.18s ease;
}

.cat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.cat-thumb {
  position: relative;
  height: 116px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #f3f7ff, #e8f0ff);
  color: #1d4ed8;
}

.cat-thumb .icon {
  width: 42px;
  height: 42px;
}

.cat-thumb.part {
  background: linear-gradient(145deg, #f9f7ff, #efe9ff);
  color: var(--violet);
}

.cat-thumb.accessory {
  background: linear-gradient(145deg, #f1fdfa, #e3faf5);
  color: var(--teal);
}

.cat-thumb .cat-type {
  position: absolute;
  top: 9px;
  left: 9px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 8.5px;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #475569;
  backdrop-filter: blur(6px);
}

.cat-body {
  padding: 11px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.cat-brand {
  font-size: 9px;
  color: var(--muted-2);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 1px;
}

.cat-name {
  font-size: 12px;
  font-weight: 750;
  line-height: 1.3;
  letter-spacing: -0.01em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 31px;
}

.cat-price {
  margin-top: 7px;
  font-size: 14.5px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.cat-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
}

.cat-stock {
  font-size: 9px;
  color: var(--muted);
}

.cat-stock.low {
  color: var(--amber);
  font-weight: 700;
}

.cat-add {
  width: 33px;
  height: 33px;
  border-radius: 10px;
  border: 0;
  display: grid;
  place-items: center;
  background: var(--blue);
  color: #fff;
  box-shadow: 0 5px 12px rgba(37, 99, 235, 0.25);
  transition: 0.16s ease;
}

.cat-add:hover {
  background: var(--blue-dark);
}

.cat-add:disabled {
  background: #e2e8f0;
  color: #94a3b8;
  box-shadow: none;
  cursor: not-allowed;
}

.cat-add .icon {
  width: 17px;
  height: 17px;
}

@media (min-width: 620px) {
  .cat-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
  }

  .cat-thumb {
    height: 150px;
  }

  .cat-thumb .icon {
    width: 54px;
    height: 54px;
  }

  .cat-body {
    padding: 13px;
  }

  .cat-name {
    font-size: 13.5px;
    min-height: 35px;
  }

  .cat-price {
    font-size: 16px;
  }
}

@media (min-width: 1180px) {
  .cat-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 1500px) {
  .cat-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

.cart-line {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 0;
  border-bottom: 1px solid #f1f5f9;
  min-width: 0;
}

.cart-line:last-child {
  border-bottom: 0;
}

.cart-line .thumb {
  width: 44px;
  height: 44px;
  border-radius: 12px;
}

.cart-line .thumb .icon {
  width: 20px;
  height: 20px;
}

.cart-line-main {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.cart-line-main strong {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cart-line-main span {
  display: block;
  font-size: 10px;
  color: var(--muted);
}

.qty-stepper {
  display: flex;
  align-items: center;
  gap: 1px;
  border: 1px solid var(--line);
  border-radius: 9px;
  overflow: hidden;
  flex-shrink: 0;
}

.qty-stepper button {
  width: 28px;
  height: 28px;
  border: 0;
  background: #f8fafc;
  color: #475569;
  display: grid;
  place-items: center;
}

.qty-stepper button:hover {
  background: #eef2f8;
}

.qty-stepper span {
  min-width: 24px;
  text-align: center;
  font-size: 11.5px;
  font-weight: 750;
}

.cart-summary {
  margin-top: 14px;
  padding: 13px;
  border-radius: 13px;
  background: #f8fafc;
}

.cart-summary-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  color: var(--muted);
  padding: 2px 0;
}

.cart-summary-row.total {
  margin-top: 7px;
  padding-top: 8px;
  border-top: 1px dashed #dbe3ef;
  color: var(--text);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

/* --------------------------------- Modals --------------------------------- */

#modal-root:empty {
  display: none;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(15, 23, 42, 0.52);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: fadeIn 0.2s ease both;
}

.modal {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-height: 92dvh;
  background: #fff;
  border-radius: 24px 24px 0 0;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.28s cubic-bezier(0.22, 1, 0.36, 1) both;
  overflow: hidden;
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 17px 18px 14px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  flex-shrink: 0;
}

.modal-title {
  font-size: 16.5px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.25;
}

.modal-sub {
  color: var(--muted);
  font-size: 11.5px;
  margin-top: 2px;
}

.modal-close {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  display: grid;
  place-items: center;
  color: var(--muted);
  flex-shrink: 0;
  transition: 0.16s ease;
}

.modal-close:hover {
  background: #f8fafc;
  color: var(--text);
}

.modal-body {
  padding: 18px;
  overflow-y: auto;
  overscroll-behavior: contain;
  min-width: 0;
}

.modal-grab {
  width: 38px;
  height: 4px;
  background: #dbe3ef;
  border-radius: 999px;
  margin: 8px auto -4px;
  flex-shrink: 0;
}

@media (min-width: 700px) {
  .modal-backdrop {
    align-items: center;
    padding: 24px;
  }

  .modal {
    max-width: 560px;
    max-height: 88vh;
    border-radius: 24px;
    animation: modalIn 0.24s cubic-bezier(0.22, 1, 0.36, 1) both;
  }

  .modal.modal-lg {
    max-width: 800px;
  }

  .modal.modal-xl {
    max-width: 960px;
  }

  .modal-grab {
    display: none;
  }

  .modal-head {
    padding: 20px 22px 16px;
  }

  .modal-body {
    padding: 22px;
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* --------------------------------- Toasts --------------------------------- */

#toast-root {
  position: fixed;
  z-index: 200;
  top: 14px;
  left: 14px;
  right: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: 420px;
  width: fit-content;
  padding: 11px 15px;
  border-radius: 13px;
  background: var(--navy);
  color: #fff;
  font-size: 12.5px;
  font-weight: 600;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.28);
  animation: toastIn 0.28s ease both;
}

.toast.success {
  background: #14532d;
}

.toast.error {
  background: #7f1d1d;
}

.toast .icon {
  width: 17px;
  height: 17px;
}

.toast.out {
  animation: toastOut 0.22s ease both;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(-10px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toastOut {
  to { opacity: 0; transform: translateY(-8px); }
}

@media (min-width: 700px) {
  #toast-root {
    left: auto;
    right: 20px;
    top: 20px;
    align-items: flex-end;
  }
}

/* --------------------------------- Detail --------------------------------- */

.detail-grid {
  display: grid;
  gap: 13px;
}

.detail-card {
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 14px;
  background: #fff;
}

.detail-card.tint {
  background: #f8fafc;
}

.detail-card h4 {
  font-size: 11px;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted-2);
  margin-bottom: 7px;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  font-size: 12px;
  padding: 3px 0;
}

.detail-row span {
  color: var(--muted);
  flex-shrink: 0;
}

.detail-row strong {
  font-weight: 650;
  text-align: right;
  word-break: break-word;
}

.detail-row.total {
  margin-top: 8px;
  padding-top: 9px;
  border-top: 1px dashed #dbe3ef;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.detail-row.total span {
  color: var(--text);
}

.info-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  padding: 3px 0;
}

.info-line .icon {
  width: 15px;
  height: 15px;
  color: var(--muted-2);
}

.info-line strong {
  color: var(--text);
  font-weight: 650;
}

.receipt-id {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 13px;
}

.receipt-id h3 {
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.receipt-id p {
  font-size: 11px;
  color: var(--muted);
  margin-top: 1px;
}

.line-items {
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}

.line-item {
  display: flex;
  gap: 12px;
  padding: 11px 13px;
  border-bottom: 1px solid #f1f5f9;
  align-items: center;
}

.line-item:last-child {
  border-bottom: 0;
}

.line-item-main {
  flex: 1;
  min-width: 0;
}

.line-item-main strong {
  display: block;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.35;
}

.line-item-main span {
  display: block;
  font-size: 9.5px;
  color: var(--muted);
}

.line-item-side {
  text-align: right;
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 750;
}

.line-item-side span {
  display: block;
  font-size: 9.5px;
  color: var(--muted);
  font-weight: 500;
}

/* --------------------------------- Timeline -------------------------------- */

.timeline {
  display: flex;
  flex-direction: column;
}

.tl-item {
  display: flex;
  gap: 11px;
  position: relative;
  padding-bottom: 15px;
}

.tl-item:last-child {
  padding-bottom: 0;
}

.tl-item::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 15px;
  bottom: 0;
  width: 1.5px;
  background: #e2e8f0;
}

.tl-item:last-child::before {
  display: none;
}

.tl-dot {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 2px solid #cbd5e1;
  background: #fff;
  flex-shrink: 0;
  margin-top: 2px;
  z-index: 1;
}

.tl-item.current .tl-dot {
  border-color: var(--blue);
  background: var(--blue);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.tl-item.done .tl-dot {
  border-color: var(--green);
  background: var(--green);
}

.tl-main {
  flex: 1;
  min-width: 0;
}

.tl-main strong {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
}

.tl-main span {
  display: block;
  font-size: 10px;
  color: var(--muted);
  margin-top: 1px;
}

.tl-time {
  font-size: 9px;
  color: var(--muted-2);
  white-space: nowrap;
  flex-shrink: 0;
}

/* -------------------------------- Sale builder ----------------------------- */

.sale-builder {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.sale-builder > * {
  min-width: 0;
}

.sale-results {
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  max-height: 250px;
  overflow-y: auto;
}

.result-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border-bottom: 1px solid #f1f5f9;
}

.result-row:last-child {
  border-bottom: 0;
}

.result-row .thumb {
  width: 34px;
  height: 34px;
  border-radius: 9px;
}

.result-row .thumb .icon {
  width: 16px;
  height: 16px;
}

.result-main {
  flex: 1;
  min-width: 0;
}

.result-main strong {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.result-main span {
  display: block;
  font-size: 9.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.result-price {
  text-align: right;
  flex-shrink: 0;
  font-size: 10.5px;
  font-weight: 750;
}

.result-price span {
  display: block;
  font-size: 8.5px;
  color: var(--muted);
  font-weight: 500;
}

.result-add {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: #fff;
  display: grid;
  place-items: center;
  color: var(--blue);
  flex-shrink: 0;
}

.result-add:hover {
  background: var(--blue-soft);
  border-color: #bfdbfe;
}

.result-add .icon {
  width: 15px;
  height: 15px;
}

.sale-cart {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 4px 12px;
  min-height: 54px;
  min-width: 0;
}

.sale-cart-empty {
  text-align: center;
  color: var(--muted);
  font-size: 11.5px;
  padding: 17px 6px;
}

.sale-total-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-radius: 13px;
  padding: 12px 14px;
  background: var(--navy);
  color: #fff;
}

.sale-total-box span {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.62);
}

.sale-total-box strong {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.04em;
}

@media (max-width: 480px) {
  .cart-line {
    gap: 8px;
  }

  .cart-line .thumb {
    width: 38px;
    height: 38px;
  }

  .qty-stepper button {
    width: 25px;
    height: 27px;
  }

  .qty-stepper span {
    min-width: 20px;
  }

  .cart-line .unit-price {
    font-size: 11.5px;
    white-space: nowrap;
  }
}

/* ------------------------------- Empty/loading ----------------------------- */

.empty {
  text-align: center;
  padding: 34px 18px;
  color: var(--muted);
}

.empty-icon {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  background: #f1f5f9;
  color: #94a3b8;
  display: grid;
  place-items: center;
  margin: 0 auto 11px;
}

.empty h3 {
  font-size: 14px;
  font-weight: 750;
  color: var(--text);
  margin-bottom: 3px;
}

.empty p {
  font-size: 11.5px;
  max-width: 300px;
  margin: 0 auto 13px;
}

.skeleton {
  background: linear-gradient(90deg, #eef2f8 25%, #f8fafc 37%, #eef2f8 63%);
  background-size: 400% 100%;
  animation: shimmer 1.2s ease infinite;
  border-radius: 12px;
}

@keyframes shimmer {
  from { background-position: 100% 0; }
  to { background-position: 0 0; }
}

.skeleton-page {
  display: grid;
  gap: 14px;
}

.skeleton-kpis {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.skeleton-kpi {
  height: 92px;
}

.skeleton-hero {
  height: 168px;
  border-radius: 24px;
}

.skeleton-list {
  height: 72px;
}

@media (min-width: 700px) {
  .skeleton-kpis {
    grid-template-columns: repeat(4, 1fr);
  }
}

.spinner {
  width: 17px;
  height: 17px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  animation: spin 0.7s linear infinite;
}

.spinner.dark {
  border-color: #cbd5e1;
  border-top-color: var(--blue);
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.divider {
  height: 1px;
  background: var(--line);
  margin: 14px 0;
}

.stack {
  display: grid;
  gap: 12px;
}

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

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

.grow {
  flex: 1;
  min-width: 0;
}

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 6px; }
.mt-2 { margin-top: 12px; }
.mt-3 { margin-top: 18px; }
.mb-1 { margin-bottom: 6px; }
.mb-2 { margin-bottom: 12px; }
.mb-3 { margin-bottom: 18px; }

@media (max-width: 480px) {
  .hide-xs {
    display: none !important;
  }
}

@media (min-width: 640px) {
  .hide-sm-up {
    display: none !important;
  }
}

@media (min-width: 900px) {
  .detail-grid.two {
    grid-template-columns: 1fr 1fr;
  }
}
