:root {
  color-scheme: light;
  --ink: #101010;
  --ink-soft: #5f5b56;
  --black: #000000;
  --surface: #ffffff;
  --canvas: #f6f3ee;
  --line: #e8e2da;
  --orange: #ef6c00;
  --orange-dark: #bd4f00;
  --orange-soft: #fff1e5;
  --green: #247a52;
  --green-soft: #e9f7ef;
  --red: #b53b39;
  --red-soft: #fff0ef;
  --shadow: 0 18px 48px rgba(31, 24, 18, 0.09);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --number-font: "DM Sans", "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--canvas);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at top right, rgba(239, 108, 0, 0.08), transparent 28rem),
    var(--canvas);
  font-family: "DM Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-variant-numeric: lining-nums;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  border: 0;
}

.skip-link {
  position: fixed;
  top: -5rem;
  left: 1rem;
  z-index: 100;
  padding: 0.75rem 1rem;
  color: white;
  background: var(--black);
  border-radius: 0.5rem;
}

.skip-link:focus {
  top: 1rem;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(260px, 0.85fr) minmax(390px, 1.15fr);
  color: white;
  background: var(--black);
}

.brand-panel {
  position: relative;
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 3rem;
  color: white;
  background: var(--black);
}

.brand-panel::before,
.brand-panel::after {
  content: "";
  position: absolute;
  width: 24rem;
  height: 24rem;
  border: 1px solid rgba(239, 108, 0, 0.3);
  border-radius: 50%;
}

.brand-panel::before {
  top: -12rem;
  left: -10rem;
}

.brand-panel::after {
  right: -12rem;
  bottom: -14rem;
}

.brand-content {
  position: relative;
  z-index: 1;
  width: min(100%, 30rem);
}

.brand-logo {
  width: min(100%, 23rem);
  aspect-ratio: 1;
  object-fit: contain;
  display: block;
  margin: -4.5rem auto -4rem;
}

.brand-kicker {
  margin: 0;
  color: var(--orange);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.brand-title {
  max-width: 28rem;
  margin: 0.85rem 0 1rem;
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(2rem, 4vw, 3.8rem);
  line-height: 1.05;
}

.brand-copy {
  max-width: 27rem;
  margin: 0;
  color: rgba(255, 255, 255, 0.68);
  font-size: 1rem;
  line-height: 1.7;
}

.login-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background:
    radial-gradient(circle at 82% 18%, rgba(239, 108, 0, 0.14), transparent 19rem),
    var(--black);
}

.login-card {
  width: min(100%, 30rem);
  padding: clamp(1.5rem, 4vw, 2.5rem);
  color: white;
  background: rgba(0, 0, 0, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-xl);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.48), 0 0 0 1px rgba(239, 108, 0, 0.04);
  backdrop-filter: blur(10px);
}

.mobile-logo {
  display: none;
  width: min(100%, 16rem);
  height: auto;
  margin: -2.4rem auto -2rem;
  object-fit: contain;
}

.eyebrow {
  margin: 0 0 0.35rem;
  color: var(--orange-dark);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.login-card h1,
.page-title {
  margin-bottom: 0.55rem;
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(2rem, 4vw, 2.7rem);
  line-height: 1.08;
}

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

.login-card .muted {
  color: rgba(255, 255, 255, 0.68);
}

.login-card .ghost-btn {
  color: rgba(255, 255, 255, 0.76);
}

.login-card .ghost-btn:hover,
.login-card .ghost-btn:focus-visible {
  color: white;
  background: rgba(255, 255, 255, 0.07);
}

.form-stack {
  display: grid;
  gap: 1rem;
  margin-top: 1.8rem;
}

.field {
  display: grid;
  gap: 0.45rem;
}

.field label {
  font-size: 0.9rem;
  font-weight: 700;
}

.field input,
.field select,
.field textarea,
.sale-input {
  width: 100%;
  min-height: 3.4rem;
  padding: 0.8rem 1rem;
  color: var(--ink);
  background: var(--surface);
  border: 1.5px solid #d9d2c9;
  border-radius: var(--radius-md);
  outline: none;
  transition: border 160ms ease, box-shadow 160ms ease;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.sale-input:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 4px rgba(239, 108, 0, 0.12);
}

.password-wrap {
  position: relative;
}

.password-wrap input {
  padding-right: 5rem;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 0.9rem;
  transform: translateY(-50%);
  padding: 0.45rem;
  color: var(--orange-dark);
  background: transparent;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}

.primary-btn,
.secondary-btn,
.ghost-btn,
.danger-btn {
  min-height: 3.3rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.75rem 1.15rem;
  border-radius: var(--radius-md);
  font-weight: 700;
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.primary-btn {
  color: white;
  background: var(--orange);
  box-shadow: 0 9px 20px rgba(239, 108, 0, 0.22);
}

.primary-btn:hover,
.primary-btn:focus-visible {
  background: var(--orange-dark);
  transform: translateY(-1px);
}

.primary-btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

.secondary-btn {
  color: var(--ink);
  background: white;
  border: 1px solid var(--line);
}

.ghost-btn {
  min-height: 2.7rem;
  color: var(--ink-soft);
  background: transparent;
}

.danger-btn {
  min-height: 2.7rem;
  color: var(--red);
  background: var(--red-soft);
}

.demo-box {
  margin-top: 1.5rem;
  padding: 1rem;
  background: var(--orange-soft);
  border: 1px solid #ffd7b7;
  border-radius: var(--radius-md);
}

.demo-box p {
  margin-bottom: 0.8rem;
  font-size: 0.86rem;
}

.demo-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}

.demo-actions button {
  min-height: 2.8rem;
  padding: 0.65rem;
  color: var(--ink);
  background: white;
  border: 1px solid #f2c49e;
  border-radius: 0.7rem;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}

.security-note {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  margin: 1.25rem 0 0;
  color: var(--ink-soft);
  font-size: 0.8rem;
  line-height: 1.5;
}

.login-card .security-note {
  color: rgba(255, 255, 255, 0.62);
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 16.5rem minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 1.4rem 1rem;
  color: white;
  background: var(--black);
}

.sidebar-logo {
  width: 10rem;
  height: 5.6rem;
  margin: -0.8rem auto 0.75rem;
  object-fit: cover;
  object-position: center;
}

.role-pill {
  align-self: flex-start;
  margin: 0 0.5rem 1.2rem;
  padding: 0.38rem 0.65rem;
  color: #ffb879;
  background: rgba(239, 108, 0, 0.13);
  border: 1px solid rgba(239, 108, 0, 0.25);
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav-list {
  display: grid;
  gap: 0.35rem;
}

.nav-item {
  width: 100%;
  min-height: 3rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.75rem 0.9rem;
  color: rgba(255, 255, 255, 0.68);
  background: transparent;
  border-radius: 0.85rem;
  text-align: left;
  font-weight: 600;
  cursor: pointer;
}

.nav-item:hover,
.nav-item.active {
  color: white;
  background: rgba(255, 255, 255, 0.08);
}

.nav-item.active {
  box-shadow: inset 3px 0 var(--orange);
}

.nav-icon {
  width: 1.5rem;
  font-size: 1.15rem;
  text-align: center;
}

.sidebar-footer {
  margin-top: auto;
  padding: 1rem 0.5rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.user-name {
  margin-bottom: 0.1rem;
  font-weight: 700;
}

.user-meta {
  margin-bottom: 0.75rem;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.78rem;
}

.logout-btn {
  padding: 0;
  color: #ffad67;
  background: transparent;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}

.main-area {
  min-width: 0;
  padding: 2rem clamp(1.2rem, 4vw, 3.5rem) 6rem;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.7rem;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.topbar-logout {
  display: none;
  min-height: 2.6rem;
  padding: 0.55rem 0.85rem;
  color: var(--orange-dark);
  background: white;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 800;
  cursor: pointer;
}

.greeting {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.date-chip {
  padding: 0.6rem 0.85rem;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
}

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.page-header p {
  margin-bottom: 0;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.stat-card,
.content-card,
.sale-hero,
.success-card {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 35px rgba(31, 24, 18, 0.055);
}

.stat-card {
  min-height: 9rem;
  padding: 1.2rem;
}

.stat-label {
  margin-bottom: 0.7rem;
  color: var(--ink-soft);
  font-size: 0.82rem;
  font-weight: 600;
}

.stat-value {
  margin-bottom: 0.35rem;
  font-family: var(--number-font);
  font-size: clamp(1.55rem, 3vw, 2.1rem);
  font-weight: 700;
  font-variant-numeric: lining-nums tabular-nums;
  font-feature-settings: "lnum" 1, "tnum" 1;
  letter-spacing: -0.025em;
  line-height: 1;
}

.stat-help {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.76rem;
}

.top-category-result {
  display: grid;
  gap: 0.18rem;
  margin-top: 1rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--line);
}

.top-category-result span,
.top-category-result small {
  color: var(--ink-soft);
  font-size: 0.72rem;
}

.top-category-result strong {
  color: var(--orange-dark);
  font-size: 0.95rem;
}

.accent-card {
  color: white;
  background: linear-gradient(145deg, #181818, #050505);
  border-color: #1e1e1e;
}

.accent-card .stat-label,
.accent-card .stat-help {
  color: rgba(255, 255, 255, 0.58);
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(17rem, 0.55fr);
  gap: 1rem;
  margin-top: 1rem;
}

.content-card {
  padding: 1.25rem;
}

.inventory-filters {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
  padding: 0.7rem;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.inventory-filters > span {
  margin-left: 0.3rem;
  color: var(--ink-soft);
  font-size: 0.78rem;
  font-weight: 700;
}

.filter-chip {
  min-height: 2.35rem;
  padding: 0.55rem 0.9rem;
  color: var(--ink-soft);
  background: transparent;
  border-radius: 999px;
  font-weight: 700;
  cursor: pointer;
}

.filter-chip:hover,
.filter-chip:focus-visible {
  color: var(--orange-dark);
  background: var(--orange-soft);
  outline: none;
}

.filter-chip.active {
  color: white;
  background: var(--black);
}

.category-overview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.8rem;
  margin-top: 1rem;
}

.category-card {
  display: grid;
  gap: 0.8rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.category-card h2,
.category-card p {
  margin: 0;
}

.category-card h2 {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 1.1rem;
}

.category-card p {
  margin-top: 0.18rem;
  color: var(--ink-soft);
  font-size: 0.78rem;
}

.category-values {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  color: var(--ink-soft);
  font-size: 0.7rem;
}

.category-values strong {
  display: block;
  margin-top: 0.12rem;
  color: var(--ink);
  font-family: var(--number-font);
  font-size: 0.78rem;
  font-variant-numeric: lining-nums tabular-nums;
}

.inventory-category-section + .inventory-category-section {
  margin-top: 1.4rem;
}

.inventory-category-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 0.7rem;
  background: var(--orange-soft);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.inventory-category-head h3,
.inventory-category-head span {
  margin: 0;
}

.inventory-category-head h3 {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 1.05rem;
}

.inventory-category-head span {
  color: var(--orange-dark);
  font-size: 0.76rem;
  font-weight: 700;
}

.material-pill {
  display: inline-flex;
  align-items: center;
  min-height: 1.75rem;
  padding: 0.32rem 0.58rem;
  color: #80501e;
  background: #fff0c9;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 800;
}

.material-pill.prata {
  color: #4b5662;
  background: #edf1f5;
}

.form-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.card-head h2,
.content-card h2 {
  margin: 0;
  font-size: 1.05rem;
}

.text-link {
  min-height: 2.75rem;
  display: inline-flex;
  align-items: center;
  padding: 0.55rem 0.15rem;
  color: var(--orange-dark);
  background: transparent;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}

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

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.87rem;
}

.data-table th,
.data-table td {
  padding: 0.85rem 0.7rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

.data-table th {
  color: var(--ink-soft);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.data-table tr:last-child td {
  border-bottom: 0;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.58rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
}

.status::before {
  content: "";
  width: 0.42rem;
  height: 0.42rem;
  background: currentColor;
  border-radius: 50%;
}

.status.received,
.status.active {
  color: var(--green);
  background: var(--green-soft);
}

.status.draft,
.status.pending,
.status.sent {
  color: #9c560d;
  background: var(--orange-soft);
}

.status.closed,
.status.cancelled {
  color: var(--ink-soft);
  background: #efedea;
}

.status.overdue {
  color: var(--red);
  background: var(--red-soft);
}

.status.partial {
  color: #7a5a13;
  background: #fff8d9;
}

.status.settled {
  color: var(--green);
  background: var(--green-soft);
}

.progress-block {
  margin-top: 1.1rem;
}

.progress-labels {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.5rem;
  font-size: 0.78rem;
  font-weight: 700;
}

.progress-track {
  height: 0.65rem;
  overflow: hidden;
  background: #eee9e2;
  border-radius: 999px;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--orange), #ff9b46);
  border-radius: 999px;
}

.commission-rate {
  margin: 1.3rem 0 0.25rem;
  font-family: var(--number-font);
  font-size: 2.7rem;
  font-weight: 700;
  font-variant-numeric: lining-nums tabular-nums;
  font-feature-settings: "lnum" 1, "tnum" 1;
  letter-spacing: -0.025em;
}

.commission-detail {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.83rem;
  line-height: 1.55;
}

.sale-layout {
  width: min(100%, 52rem);
  margin: 0 auto;
}

.sale-hero {
  position: relative;
  overflow: hidden;
  padding: clamp(1.3rem, 5vw, 2.3rem);
}

.sale-hero::after {
  content: "";
  position: absolute;
  top: -5rem;
  right: -5rem;
  width: 12rem;
  height: 12rem;
  background: var(--orange-soft);
  border-radius: 50%;
  opacity: 0.7;
}

.sale-step {
  position: relative;
  z-index: 1;
}

.step-number {
  width: 2.1rem;
  height: 2.1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  color: white;
  background: var(--orange);
  border-radius: 50%;
  font-weight: 800;
}

.sale-hero h2 {
  margin-bottom: 0.45rem;
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(1.55rem, 4vw, 2.1rem);
}

.sale-code-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 0.7rem;
  margin-top: 1.3rem;
}

.sale-search-combobox {
  position: relative;
  min-width: 0;
}

.sale-input {
  width: 100%;
  min-height: 4rem;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.sale-search-help {
  display: block;
  margin-top: 0.45rem;
  color: var(--ink-soft);
  line-height: 1.4;
}

.sale-suggestions {
  max-height: 20rem;
  overflow-y: auto;
  margin-top: 0.35rem;
  padding: 0.35rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: 0 1rem 2.2rem rgba(46, 30, 20, 0.16);
}

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

.sale-suggestion {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-radius: calc(var(--radius-md) - 0.3rem);
  text-align: left;
  cursor: pointer;
}

.sale-suggestion + .sale-suggestion {
  border-top: 1px solid var(--line);
}

.sale-suggestion:hover,
.sale-suggestion:focus-visible,
.sale-suggestion.is-active {
  background: var(--orange-soft);
  outline: none;
}

.sale-suggestion > span:first-child {
  display: grid;
  gap: 0.18rem;
}

.sale-suggestion-product {
  display: flex !important;
  align-items: center;
  gap: 0.7rem !important;
  min-width: 0;
}

.sale-suggestion-product > span:last-child {
  display: grid;
  gap: 0.18rem;
  min-width: 0;
}

.sale-suggestion strong {
  color: var(--orange-dark);
  font-size: 0.9rem;
  letter-spacing: 0.06em;
}

.sale-suggestion small {
  color: var(--ink-soft);
  font-size: 0.83rem;
}

.sale-suggestion-empty {
  margin: 0;
  padding: 1rem;
  color: var(--ink-soft);
  text-align: center;
}

.sale-code-form .primary-btn {
  min-width: 9rem;
}

.product-confirm {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: center;
  margin-top: 1rem;
  padding: 1.2rem;
  background: var(--orange-soft);
  border: 1px solid #ffd6b2;
  border-radius: var(--radius-md);
}

.product-confirm-copy {
  min-width: 0;
}

.product-code {
  margin-bottom: 0.2rem;
  color: var(--orange-dark);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.product-name {
  margin-bottom: 0.3rem;
  font-weight: 800;
}

.product-price {
  margin: 0;
  color: var(--ink-soft);
}

.confirm-actions {
  display: grid;
  gap: 0.45rem;
}

.recent-sales {
  margin-top: 1rem;
}

.mobile-summary {
  display: none;
}

.empty-state {
  padding: 2.5rem 1rem;
  color: var(--ink-soft);
  text-align: center;
}

.empty-icon {
  display: block;
  margin-bottom: 0.7rem;
  font-size: 2rem;
}

.list-stack {
  display: grid;
  gap: 0.75rem;
}

.list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
  background: #fbfaf8;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.list-item h3 {
  margin-bottom: 0.25rem;
  font-size: 0.95rem;
}

.list-item p {
  margin-bottom: 0;
  color: var(--ink-soft);
  font-size: 0.8rem;
}

.logout-list-item {
  color: var(--red);
  background: var(--red-soft);
  border-color: rgba(176, 35, 30, 0.16);
}

.money {
  font-family: var(--number-font);
  font-weight: 800;
  font-variant-numeric: lining-nums tabular-nums;
  font-feature-settings: "lnum" 1, "tnum" 1;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.data-table,
.date-chip,
.progress-labels,
input[type="number"] {
  font-variant-numeric: lining-nums tabular-nums;
  font-feature-settings: "lnum" 1, "tnum" 1;
}

.finance-entry-actions {
  display: grid;
  justify-items: end;
  gap: 0.55rem;
}

@media (max-width: 560px) {
  .finance-entry-item {
    align-items: stretch;
    flex-direction: column;
  }

  .finance-entry-actions {
    justify-items: start;
    width: 100%;
  }
}

.commission-table input {
  width: 7.5rem;
  min-height: 2.6rem;
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 0.6rem;
}

.callout {
  margin-top: 1rem;
  padding: 1rem;
  color: #72400c;
  background: var(--orange-soft);
  border: 1px solid #ffd5b0;
  border-radius: var(--radius-md);
  font-size: 0.86rem;
  line-height: 1.55;
}

.birthday-greeting {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 0 0 1.25rem;
  padding: 1.15rem 1.25rem;
  color: #3d2607;
  background: linear-gradient(135deg, #fff8df, #ffe7ca);
  border: 1px solid #efc889;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 28px rgba(112, 68, 9, 0.08);
}

.birthday-icon {
  flex: 0 0 auto;
  font-size: 2.15rem;
}

.birthday-kicker {
  margin: 0 0 0.15rem;
  color: #9a5a08;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.birthday-greeting h2 {
  margin: 0;
  font-size: clamp(1.1rem, 3vw, 1.45rem);
}

.birthday-greeting p:last-child {
  margin: 0.25rem 0 0;
  line-height: 1.45;
}

.birthday-today-badge {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.16rem 0.45rem;
  color: #714104;
  background: #fff0bf;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 800;
}

@media (max-width: 560px) {
  .birthday-greeting {
    align-items: flex-start;
    margin-top: -0.2rem;
    padding: 1rem;
  }

  .birthday-icon {
    font-size: 1.75rem;
  }
}

.upload-dropzone {
  min-height: 10.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  margin-top: 1.2rem;
  padding: 1.25rem;
  color: var(--ink);
  background: #fbfaf8;
  border: 2px dashed #d8c9bb;
  border-radius: var(--radius-md);
  text-align: center;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease;
}

.upload-dropzone:hover,
.upload-dropzone:focus-within {
  background: var(--orange-soft);
  border-color: var(--orange);
}

.upload-dropzone input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.upload-dropzone span:not(.upload-icon) {
  color: var(--ink-soft);
  font-size: 0.82rem;
}

.upload-icon {
  width: 2.8rem;
  height: 2.8rem;
  display: grid;
  place-items: center;
  margin-bottom: 0.35rem;
  color: white;
  background: var(--orange);
  border-radius: 50%;
  font-size: 1.35rem;
  font-weight: 800;
}

.upload-selection {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin: 0.8rem 0 1rem;
  padding: 0.8rem 0.9rem;
  color: var(--ink-soft);
  background: white;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  font-size: 0.84rem;
}

.upload-selection strong {
  color: var(--ink);
}

.spreadsheet-error {
  color: var(--red);
  font-weight: 700;
}

.spreadsheet-preview {
  display: grid;
  gap: 0.8rem;
  margin-top: 1rem;
}

.spreadsheet-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.65rem;
}

.spreadsheet-summary span {
  display: grid;
  gap: 0.15rem;
  padding: 0.75rem;
  color: var(--ink-soft);
  background: #f7f5f2;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  font-size: 0.78rem;
}

.spreadsheet-summary strong {
  color: var(--ink);
  font-family: var(--number-font);
  font-size: 1.15rem;
  font-variant-numeric: lining-nums tabular-nums;
}

.spreadsheet-summary .has-error,
.spreadsheet-summary .has-error strong {
  color: var(--red);
  background: var(--red-soft);
  border-color: #f1c5c5;
}

.spreadsheet-row-message {
  display: block;
  max-width: 15rem;
  margin-top: 0.35rem;
  color: var(--ink-soft);
  line-height: 1.35;
}

.spreadsheet-cell-input {
  width: min(10rem, 100%);
  min-width: 7rem;
  padding: 0.48rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 0.55rem;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

.spreadsheet-cell-input:focus {
  outline: 2px solid rgba(169, 126, 51, 0.25);
  border-color: var(--gold);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.62);
}

.modal {
  width: min(100%, 32rem);
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  padding: 1.4rem;
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.modal.modal-wide {
  width: min(100%, 48rem);
}

@media (max-width: 540px) {
  .spreadsheet-summary {
    grid-template-columns: 1fr;
  }
}

.closing-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.closing-toolbar p {
  margin: 0;
}

.receipt-card {
  margin-top: 0;
}

.receipt-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1rem;
}

.receipt-toolbar p {
  margin: 0;
}

.receipt-items {
  display: grid;
  gap: 0.75rem;
}

.receipt-item {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.85rem;
  min-height: 4.5rem;
  padding: 0.9rem 1rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.receipt-item:active {
  transform: scale(0.995);
}

.receipt-item.is-confirmed {
  background: var(--green-soft);
  border-color: #9cc5b5;
}

.receipt-item input {
  width: 1.55rem;
  height: 1.55rem;
  accent-color: var(--green);
}

.receipt-item > span:nth-child(3) {
  display: grid;
  gap: 0.2rem;
}

.receipt-item small {
  color: var(--ink-soft);
}

.receipt-item-state {
  color: var(--orange-dark);
  font-size: 0.78rem;
  font-weight: 800;
}

.receipt-item.is-confirmed .receipt-item-state {
  color: var(--green);
}

.closing-items {
  display: grid;
  gap: 0.8rem;
}

.closing-item {
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.closing-check {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.8rem;
  padding: 1rem;
  cursor: pointer;
}

.closing-check input {
  width: 1.4rem;
  height: 1.4rem;
  accent-color: var(--orange);
}

.closing-check > span:nth-child(3) {
  display: grid;
  gap: 0.2rem;
}

.product-photo {
  width: 3.25rem;
  height: 3.25rem;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: var(--orange-dark);
  background: #f3eee8;
  border: 1px solid var(--line);
  border-radius: 0.85rem;
  vertical-align: middle;
}

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

.product-photo-placeholder {
  font-size: 1.35rem;
  font-weight: 800;
}

.product-photo.table {
  width: 2.8rem;
  height: 2.8rem;
  border-radius: 0.7rem;
}

.product-photo.large {
  width: 9rem;
  height: 9rem;
  border-radius: var(--radius-md);
}

.product-photo.receipt {
  width: 3.6rem;
  height: 3.6rem;
}

.product-photo.suggestion {
  width: 3rem;
  height: 3rem;
}

.product-photo.confirmation {
  width: 5.8rem;
  height: 5.8rem;
}

.product-photo-editor {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: #fbf8f4;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.product-photo-preview {
  line-height: 0;
}

.product-photo-controls {
  min-width: 0;
}

.product-photo-controls .field input[type="file"] {
  min-height: auto;
  padding: 0.7rem;
  background: #fff;
}

.optional-label {
  color: var(--ink-soft);
  font-weight: 500;
}

.photo-status {
  margin: 0.6rem 0 0;
  color: var(--ink-soft);
  font-size: 0.84rem;
}

.danger-link {
  margin-top: 0.55rem;
  color: var(--red);
}

.table-actions {
  display: grid;
  justify-items: start;
  gap: 0.35rem;
  min-width: 10rem;
}

.product-choice,
.product-list-row {
  gap: 0.8rem;
}

.suitcase-product-picker {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.suitcase-product-picker legend {
  margin-bottom: 0.7rem;
  font-weight: 700;
}

.suitcase-picker-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
  margin: 0.15rem 0 0.75rem;
  color: var(--ink-soft);
  font-size: 0.85rem;
}

.suitcase-picker-summary p {
  margin: 0;
}

.suitcase-product-list {
  max-height: min(46vh, 30rem);
  overflow-y: auto;
  padding-right: 0.25rem;
  overscroll-behavior: contain;
}

.product-choice {
  justify-content: flex-start;
  cursor: pointer;
}

.product-choice input[type="checkbox"] {
  width: 1.25rem;
  height: 1.25rem;
  flex: 0 0 auto;
  accent-color: var(--orange-dark);
}

.product-choice.is-selected {
  background: var(--green-soft);
  border-color: #9cc5b5;
}

[data-suitcase-product][hidden],
.suitcase-picker-empty[hidden] {
  display: none;
}

.suitcase-picker-empty {
  padding: 1.5rem 1rem;
  color: var(--ink-soft);
  background: #fbfaf8;
  border: 1px dashed var(--line);
  border-radius: var(--radius-md);
  text-align: center;
}

.closing-check small {
  color: var(--ink-soft);
}

.check-confirmation {
  color: var(--orange-dark);
  font-size: 0.78rem;
  font-weight: 700;
}

.closing-item.is-returned {
  border-color: #9cc5b5;
  background: var(--green-soft);
}

.missing-resolution {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
  padding: 1rem;
  background: var(--red-soft);
  border-top: 1px solid #efd0cb;
}

.missing-resolution > p {
  grid-column: 1 / -1;
  margin: 0;
}

.closing-item.is-returned .missing-resolution {
  display: none;
}

.closing-error {
  color: #842b20;
  background: var(--red-soft);
  border-color: #e5b8b1;
}

@media (max-width: 620px) {
  .category-overview,
  .form-columns {
    grid-template-columns: 1fr;
  }

  .inventory-filters {
    border-radius: var(--radius-md);
  }

  .closing-check {
    grid-template-columns: auto auto minmax(0, 1fr);
  }

  .receipt-item {
    grid-template-columns: auto auto minmax(0, 1fr);
  }

  .receipt-item-state {
    grid-column: 3;
  }

  .check-confirmation {
    grid-column: 3;
  }

  .product-photo-editor {
    grid-template-columns: 1fr;
  }

  .product-photo-preview {
    justify-self: center;
  }

  .missing-resolution {
    grid-template-columns: 1fr;
  }
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.modal-head h2 {
  margin: 0;
  font-family: "Playfair Display", Georgia, serif;
}

.icon-btn {
  width: 2.6rem;
  height: 2.6rem;
  display: grid;
  place-items: center;
  color: var(--ink);
  background: #f3f0ec;
  border-radius: 50%;
  cursor: pointer;
}

.toast-region {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 100;
  display: grid;
  gap: 0.6rem;
}

.toast {
  width: min(23rem, calc(100vw - 2rem));
  padding: 0.9rem 1rem;
  color: white;
  background: var(--black);
  border-left: 4px solid var(--orange);
  border-radius: 0.75rem;
  box-shadow: var(--shadow);
  animation: toast-in 220ms ease both;
}

.toast.success {
  border-left-color: #58c68d;
}

.toast.error {
  border-left-color: #ff6b67;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(0.7rem);
  }
}

.bottom-nav {
  display: none;
}

@media (max-width: 1050px) {
  .cards-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .category-overview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 760px) {
  .category-overview,
  .form-columns {
    grid-template-columns: 1fr;
  }

  .login-shell {
    display: block;
  }

  .brand-panel {
    display: none;
  }

  .login-panel {
    min-height: 100vh;
    padding: 1rem;
  }

  .login-card {
    padding: 1.4rem;
  }

  .mobile-logo {
    display: block;
  }

  .app-shell {
    display: block;
  }

  .sidebar {
    display: none;
  }

  .main-area {
    padding: 1.2rem 1rem calc(6.5rem + env(safe-area-inset-bottom));
  }

  .topbar {
    margin-bottom: 1.2rem;
  }

  .date-chip {
    display: none;
  }

  .topbar-logout {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .page-header {
    display: block;
  }

  .page-header .primary-btn {
    width: 100%;
    margin-top: 1rem;
  }

  .page-header > div:last-child:not(:first-child) {
    width: 100%;
    margin-top: 1rem;
  }

  .page-header > div:last-child:not(:first-child) .primary-btn,
  .page-header > div:last-child:not(:first-child) .secondary-btn {
    width: 100%;
    margin-top: 0;
  }

  .page-title {
    font-size: 2rem;
  }

  .cards-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
  }

  .stat-card {
    min-height: 7.8rem;
    padding: 1rem;
  }

  .stat-value {
    font-size: 1.45rem;
  }

  .sale-layout {
    width: 100%;
  }

  .sale-hero {
    padding: 1.2rem;
  }

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

  .sale-code-form .primary-btn {
    width: 100%;
    min-height: 3.7rem;
  }

  .product-confirm {
    grid-template-columns: 1fr;
  }

  .confirm-actions {
    grid-template-columns: 1fr 1fr;
  }

  .confirm-actions .primary-btn,
  .confirm-actions .secondary-btn {
    min-height: 3.4rem;
  }

  .mobile-summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 1rem;
  }

  .mobile-summary .stat-card {
    min-height: auto;
  }

  .bottom-nav {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 40;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    padding: 0.45rem 0.35rem calc(0.45rem + env(safe-area-inset-bottom));
    background: rgba(11, 11, 12, 0.97);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(12px);
  }

  .bottom-nav.admin-nav {
    grid-template-columns: repeat(5, 1fr);
  }

  .bottom-nav button {
    min-height: 3.6rem;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 0.15rem;
    padding: 0.35rem;
    color: rgba(255, 255, 255, 0.55);
    background: transparent;
    border-radius: 0.7rem;
    font-size: 0.64rem;
    font-weight: 700;
    cursor: pointer;
  }

  .bottom-nav button span:first-child {
    font-size: 1.1rem;
  }

  .bottom-nav button.active {
    color: #ff9d4a;
    background: rgba(239, 108, 0, 0.1);
  }

  .data-table.responsive-table thead {
    display: none;
  }

  .data-table.responsive-table,
  .data-table.responsive-table tbody,
  .data-table.responsive-table tr,
  .data-table.responsive-table td {
    display: block;
    width: 100%;
  }

  .data-table.responsive-table tr {
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--line);
  }

  .data-table.responsive-table td {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.3rem 0;
    border: 0;
    white-space: normal;
    text-align: right;
  }

  .data-table.responsive-table td::before {
    content: attr(data-label);
    color: var(--ink-soft);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-align: left;
    text-transform: uppercase;
  }
}

@media (max-width: 390px) {
  .cards-grid,
  .mobile-summary {
    grid-template-columns: 1fr;
  }

  .demo-actions {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
