:root {
  color-scheme: light;
  --ink: #1d2528;
  --muted: #627077;
  --line: #d9e1e1;
  --paper: #fbfcfb;
  --panel: #ffffff;
  --accent: #0b6e69;
  --accent-dark: #074c49;
  --gold: #b87920;
  --rose: #b34855;
  --blue: #326b9c;
  --shadow: 0 18px 50px rgba(24, 41, 45, 0.11);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    linear-gradient(135deg, rgba(11, 110, 105, 0.08), transparent 35%),
    linear-gradient(315deg, rgba(184, 121, 32, 0.08), transparent 30%),
    var(--paper);
  color: var(--ink);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.sidebar {
  background: #162629;
  color: white;
  padding: 28px 22px;
  display: flex;
  flex-direction: column;
  gap: 26px;
}

.eyebrow,
.label {
  color: var(--gold);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0;
  margin: 0 0 6px;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  letter-spacing: 0;
  margin: 0;
}

h1 {
  font-size: 2rem;
}

h2 {
  font-size: 1.55rem;
}

h3 {
  font-size: 1.1rem;
}

nav {
  display: grid;
  gap: 8px;
}

.nav-item {
  align-items: center;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.72);
  display: flex;
  gap: 10px;
  padding: 12px 14px;
  text-decoration: none;
}

.nav-item span {
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: inline-flex;
  height: 24px;
  justify-content: center;
  width: 24px;
}

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

.shop-card {
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  margin-top: auto;
  padding: 18px;
}

.shop-card strong {
  display: block;
  font-size: 1.7rem;
}

.shop-card span {
  color: rgba(255, 255, 255, 0.68);
}

.workspace {
  min-width: 0;
  padding: 28px;
}

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

.status-strip {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: flex;
  gap: 8px;
  padding: 8px;
}

.status-strip span {
  border-right: 1px solid var(--line);
  color: var(--muted);
  min-width: 116px;
  padding: 8px 12px;
}

.status-strip span:last-child {
  border-right: 0;
}

.status-strip strong {
  color: var(--ink);
  display: block;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.checkout-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: minmax(0, 1fr) 390px;
}

.service-panel,
.cart-panel,
.queue-entry,
.queue-list,
.expense-entry,
.expense-list-panel,
.stock-entry,
.stock-list-panel,
.reports-grid > section {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 20px;
}

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

.segmented,
.payment-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: inline-flex;
  overflow: hidden;
}

.catalog-tools {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

#catalogSearch {
  min-width: 240px;
  width: 280px;
}

.segment,
.payment {
  background: transparent;
  border: 0;
  color: var(--muted);
  min-height: 40px;
  padding: 0 13px;
}

.segment.active,
.payment.active {
  background: var(--accent);
  color: white;
}

.service-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}

.service-tile {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 128px;
  padding: 16px;
  text-align: left;
  transition: transform 160ms ease, border-color 160ms ease;
}

.service-tile:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.service-tile:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

.service-tile span {
  color: var(--muted);
  display: block;
  font-size: 0.82rem;
  margin-top: 6px;
}

.service-tile strong {
  display: block;
  font-size: 1.35rem;
  margin-top: 12px;
}

.service-tile.service strong {
  color: var(--accent);
}

.service-tile.product strong {
  color: var(--blue);
}

.cart-panel {
  position: sticky;
  top: 24px;
}

.icon-button {
  align-items: center;
  background: #f4f7f7;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  display: inline-flex;
  height: 36px;
  justify-content: center;
  width: 36px;
}

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

.loyalty-card {
  align-items: start;
  background: #f7f9f8;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  justify-content: space-between;
  margin-bottom: 14px;
  padding: 12px 14px;
}

.loyalty-card span,
.loyalty-card small {
  color: var(--muted);
}

.loyalty-card strong {
  display: block;
  font-size: 1.2rem;
}

.redeem-control {
  display: grid;
  gap: 7px;
}

label {
  color: var(--muted);
  display: grid;
  font-size: 0.84rem;
  font-weight: 700;
  gap: 7px;
}

input,
select {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  min-height: 42px;
  padding: 0 12px;
  width: 100%;
}

.input-affix {
  align-items: center;
  display: flex;
  position: relative;
}

.input-affix span {
  color: var(--muted);
  position: absolute;
  right: 12px;
}

.toggle-row {
  align-items: center;
  color: var(--ink);
  display: flex;
  gap: 10px;
  padding-top: 24px;
}

.toggle-row input {
  min-height: 18px;
  width: 18px;
}

.cart-lines {
  border-bottom: 1px solid var(--line);
  border-top: 1px solid var(--line);
  margin: 6px 0 14px;
  min-height: 130px;
  padding: 10px 0;
}

.empty-state {
  color: var(--muted);
  margin: 42px 0;
  text-align: center;
}

.cart-line,
.sale-row,
.queue-card {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 12px 0;
}

.cart-line:last-child,
.sale-row:last-child,
.queue-card:last-child {
  border-bottom: 0;
}

.cart-line small,
.sale-row small,
.queue-card small {
  color: var(--muted);
  display: block;
  margin-top: 2px;
}

.quantity-tools {
  align-items: center;
  display: flex;
  gap: 7px;
}

.quantity-tools button {
  background: #f4f7f7;
  border: 1px solid var(--line);
  border-radius: 50%;
  height: 28px;
  width: 28px;
}

.totals {
  display: grid;
  gap: 8px;
  margin: 0 0 16px;
}

.totals div {
  display: flex;
  justify-content: space-between;
}

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

.totals dd {
  margin: 0;
}

.grand-total {
  border-top: 1px solid var(--line);
  font-size: 1.2rem;
  font-weight: 900;
  padding-top: 10px;
}

.payment-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  margin-bottom: 14px;
  width: 100%;
}

.primary-action {
  background: var(--accent);
  border: 0;
  border-radius: 8px;
  color: white;
  font-weight: 900;
  min-height: 48px;
  padding: 0 18px;
  width: 100%;
}

.primary-action:hover {
  background: var(--accent-dark);
}

.primary-action.compact {
  min-height: 42px;
}

.whatsapp-action {
  align-items: center;
  background: #1f8f52;
  border-radius: 8px;
  color: white;
  display: flex;
  font-weight: 900;
  justify-content: center;
  margin-top: 10px;
  min-height: 44px;
  text-decoration: none;
}

.whatsapp-action.disabled {
  background: #d8e0de;
  color: #75817e;
  cursor: not-allowed;
}

.receipt {
  background: #162629;
  border-radius: 8px;
  color: #e9f0ed;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.8rem;
  line-height: 1.55;
  margin: 14px 0 0;
  min-height: 130px;
  overflow: auto;
  padding: 14px;
  white-space: pre-wrap;
}

.queue-layout,
.expenses-layout,
.stock-layout,
.reports-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: 360px minmax(0, 1fr);
}

.queue-form,
.expense-form,
.stock-form {
  display: grid;
  gap: 12px;
}

.queue-list,
.expense-list,
.stock-list {
  display: grid;
  gap: 0;
}

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

.queue-card button {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 36px;
  padding: 0 12px;
}

.expense-row {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 12px 0;
}

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

.expense-row small {
  color: var(--muted);
  display: block;
  margin-top: 2px;
}

.stock-row {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 12px 0;
}

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

.stock-row small {
  color: var(--muted);
  display: block;
  margin-top: 2px;
}

.expense-actions {
  align-items: center;
  display: flex;
  gap: 10px;
}

.expense-actions button {
  background: #fff7f7;
  border: 1px solid #efd2d2;
  border-radius: 8px;
  color: var(--rose);
  min-height: 34px;
  padding: 0 10px;
}

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

.report-date-row {
  align-items: end;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto auto;
  margin-bottom: 16px;
}

.secondary-action {
  background: #f4f7f7;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font-weight: 800;
  min-height: 42px;
  padding: 0 16px;
}

.metric-grid article {
  background: #f7f9f8;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.metric-grid span {
  color: var(--muted);
  display: block;
}

.metric-grid strong {
  display: block;
  font-size: 1.35rem;
  margin-top: 8px;
}

.barber-sales,
.product-sales {
  border-top: 1px solid var(--line);
  margin-top: 18px;
  padding-top: 18px;
}

.compact-header {
  margin-bottom: 10px;
}

.barber-sales-list,
.product-sales-list {
  display: grid;
  gap: 8px;
}

.barber-sale-row,
.product-sale-row {
  align-items: center;
  background: #f7f9f8;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 12px 14px;
}

.barber-sale-row small,
.product-sale-row small {
  color: var(--muted);
  display: block;
  margin-top: 2px;
}

.compact-empty {
  margin: 8px 0;
}

.sales-list {
  max-height: 500px;
  overflow: auto;
}

@media (max-width: 1120px) {
  .app-shell,
  .checkout-grid,
  .queue-layout,
  .expenses-layout,
  .stock-layout,
  .reports-grid {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  .cart-panel {
    position: static;
  }
}

@media (max-width: 720px) {
  .workspace,
  .sidebar {
    padding: 18px;
  }

  .topbar,
  .panel-header,
  .status-strip {
    align-items: stretch;
    flex-direction: column;
  }

  .status-strip span {
    border-bottom: 1px solid var(--line);
    border-right: 0;
  }

  .form-grid,
  .report-date-row,
  .metric-grid {
    grid-template-columns: 1fr;
  }

  .queue-card,
  .expense-row,
  .stock-row {
    grid-template-columns: 1fr;
  }
}

/* Roman's Studio premium counter layout */
:root {
  --ink: #efe8d8;
  --muted: #9aa3a0;
  --line: rgba(221, 184, 101, 0.24);
  --paper: #0f1211;
  --panel: #171b1a;
  --accent: #c99a3a;
  --accent-dark: #9b6e22;
  --gold: #dfb65d;
  --rose: #d26b73;
  --blue: #67a7c8;
  --green: #2f9a62;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.28);
}

body {
  background:
    linear-gradient(180deg, rgba(223, 182, 93, 0.11), transparent 280px),
    radial-gradient(circle at top right, rgba(103, 167, 200, 0.12), transparent 360px),
    #0b0d0c;
  color: var(--ink);
}

.app-shell {
  display: block;
  min-height: 100vh;
}

.sidebar {
  align-items: center;
  background: rgba(12, 14, 13, 0.94);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.28);
  color: var(--ink);
  display: grid;
  gap: 18px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  padding: 16px 28px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand-lockup {
  align-items: center;
  display: flex;
  gap: 14px;
}

.brand-mark {
  align-items: center;
  background: #0b0d0c;
  border: 1px solid rgba(255, 232, 178, 0.58);
  border-radius: 50%;
  display: flex;
  height: 72px;
  justify-content: center;
  overflow: hidden;
  width: 72px;
}

.brand-mark img {
  display: block;
  height: 118%;
  object-fit: cover;
  object-position: center 43%;
  width: 100%;
}

h1 {
  font-size: 1.25rem;
}

.eyebrow,
.label {
  color: var(--gold);
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.nav-item {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(239, 232, 216, 0.76);
  min-height: 42px;
  padding: 9px 12px;
}

.nav-item span {
  border-color: rgba(223, 182, 93, 0.38);
  color: var(--gold);
}

.nav-item.active,
.nav-item:hover {
  background: var(--gold);
  border-color: var(--gold);
  color: #111312;
}

.nav-item.active span,
.nav-item:hover span {
  border-color: rgba(17, 19, 18, 0.32);
  color: #111312;
}

.shop-card {
  background: #141817;
  border-color: var(--line);
  margin-top: 0;
  min-width: 190px;
  padding: 12px 14px;
}

.shop-card strong {
  color: var(--gold);
  font-size: 1.25rem;
}

.workspace {
  margin: 0 auto;
  max-width: 1500px;
  padding: 28px;
}

.topbar {
  align-items: end;
  background:
    linear-gradient(135deg, rgba(223, 182, 93, 0.16), transparent 44%),
    #151918;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  margin-bottom: 22px;
  padding: 20px;
}

h2 {
  color: #fff7e6;
  font-size: 1.75rem;
}

.status-strip {
  background: rgba(10, 12, 11, 0.7);
  border-color: var(--line);
  box-shadow: none;
}

.status-strip span {
  border-right-color: var(--line);
  color: var(--muted);
}

.status-strip strong {
  color: var(--gold);
}

.checkout-grid {
  grid-template-columns: minmax(0, 1fr) 420px;
}

.service-panel,
.cart-panel,
.queue-entry,
.queue-list,
.expense-entry,
.expense-list-panel,
.stock-entry,
.stock-list-panel,
.reports-grid > section {
  background: rgba(23, 27, 26, 0.94);
  border-color: var(--line);
  box-shadow: var(--shadow);
}

.panel-header {
  border-bottom: 1px solid rgba(223, 182, 93, 0.16);
  padding-bottom: 14px;
}

.segmented,
.payment-row {
  background: #0f1211;
  border-color: var(--line);
}

.segment,
.payment {
  color: rgba(239, 232, 216, 0.72);
}

.segment.active,
.payment.active {
  background: var(--gold);
  color: #101211;
}

.service-grid {
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
}

.service-tile {
  background: #111514;
  border-color: rgba(223, 182, 93, 0.18);
  color: var(--ink);
}

.service-tile:hover {
  border-color: var(--gold);
}

.service-tile span,
label,
.totals dt,
.cart-line small,
.sale-row small,
.queue-card small,
.expense-row small,
.stock-row small,
.barber-sale-row small,
.product-sale-row small {
  color: var(--muted);
}

.service-tile.service strong,
.service-tile.product strong,
.grand-total,
.totals dd {
  color: var(--gold);
}

input,
select {
  background: #0f1211;
  border-color: rgba(223, 182, 93, 0.28);
  color: var(--ink);
}

input::placeholder {
  color: rgba(239, 232, 216, 0.38);
}

.loyalty-card,
.metric-grid article,
.barber-sale-row,
.product-sale-row {
  background: #101413;
  border-color: rgba(223, 182, 93, 0.18);
}

.cart-lines {
  border-bottom-color: var(--line);
  border-top-color: var(--line);
}

.cart-line,
.sale-row,
.queue-card,
.expense-row,
.stock-row {
  border-bottom-color: rgba(223, 182, 93, 0.16);
}

.quantity-tools button,
.icon-button,
.secondary-action,
.queue-card button {
  background: #101413;
  border-color: rgba(223, 182, 93, 0.28);
  color: var(--ink);
}

.primary-action {
  background: linear-gradient(145deg, #dfb65d, #a97622);
  color: #101211;
}

.primary-action:hover {
  background: linear-gradient(145deg, #f0ca70, #b98329);
}

.receipt {
  background: #090b0a;
  border: 1px solid rgba(223, 182, 93, 0.18);
  color: #f4ead2;
}

.reports-grid,
.queue-layout,
.expenses-layout,
.stock-layout {
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
}

@media (max-width: 1120px) {
  .sidebar {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  nav {
    justify-content: flex-start;
  }

  .shop-card {
    min-width: 0;
  }

  .checkout-grid,
  .reports-grid,
  .queue-layout,
  .expenses-layout,
  .stock-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .workspace,
  .sidebar {
    padding: 14px;
  }

  nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .nav-item {
    justify-content: flex-start;
  }

  .catalog-tools,
  #catalogSearch {
    width: 100%;
  }

  .topbar {
    padding: 16px;
  }
}

[hidden] {
  display: none !important;
}

body.auth-locked {
  overflow: hidden;
}

.auth-screen {
  align-items: center;
  background: #0b0d0c;
  display: grid;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 24px;
}

.auth-panel {
  background: #171b1a;
  border: 1px solid rgba(223, 182, 93, 0.3);
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
  margin: 0 auto;
  max-width: 430px;
  padding: 28px;
  width: 100%;
}

.auth-brand {
  align-items: center;
  border-bottom: 1px solid rgba(223, 182, 93, 0.18);
  display: flex;
  gap: 14px;
  padding-bottom: 20px;
}

.auth-logo {
  background: #0b0d0c;
  border: 1px solid rgba(255, 232, 178, 0.58);
  border-radius: 50%;
  height: 76px;
  overflow: hidden;
  width: 76px;
}

.auth-logo img {
  display: block;
  height: 118%;
  object-fit: cover;
  object-position: center 43%;
  width: 100%;
}

.auth-heading {
  margin: 24px 0 20px;
}

.auth-heading h2 {
  font-size: 1.45rem;
}

.auth-heading p {
  color: var(--muted);
  line-height: 1.5;
  margin: 8px 0 0;
}

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

.show-password-control {
  align-items: center;
  display: flex;
  gap: 9px;
  width: fit-content;
}

.show-password-control input {
  min-height: 18px;
  width: 18px;
}

.auth-error {
  color: #f09a9f;
  font-size: 0.86rem;
  margin: 0;
  min-height: 21px;
}

.account-modal,
.price-modal {
  align-items: center;
  background: rgba(5, 6, 6, 0.78);
  display: grid;
  inset: 0;
  padding: 20px;
  position: fixed;
  z-index: 50;
}

.account-panel,
.price-panel {
  background: #171b1a;
  border: 1px solid rgba(223, 182, 93, 0.3);
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.52);
  margin: 0 auto;
  max-width: 480px;
  padding: 24px;
  width: 100%;
}

.account-form,
.price-form {
  display: grid;
  gap: 14px;
}

.price-range {
  color: var(--muted);
  line-height: 1.5;
  margin: 0;
}

.appointment-date-row {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr 1fr;
}

.queue-card .appointment-time {
  color: var(--gold);
  font-weight: 800;
  margin: 5px 0;
}

.account-status.success {
  color: #72d39a;
}

.shop-card {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: space-between;
}

.lock-pos {
  background: #0f1211;
  border: 1px solid rgba(223, 182, 93, 0.34);
  border-radius: 8px;
  color: var(--gold);
  min-height: 40px;
  padding: 0 13px;
  white-space: nowrap;
}

.lock-pos:hover {
  border-color: var(--gold);
}

.account-actions {
  align-items: flex-end;
  display: grid;
  gap: 7px;
  justify-items: end;
}

.account-actions > span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.account-actions > div {
  display: flex;
  gap: 7px;
}

@media (max-width: 480px) {
  .auth-screen {
    padding: 14px;
  }

  .auth-panel {
    padding: 20px;
  }

  .auth-logo {
    height: 66px;
    width: 66px;
  }

  .account-modal,
  .price-modal {
    padding: 14px;
  }

  .account-panel,
  .price-panel {
    padding: 20px;
  }

  .account-actions {
    align-items: stretch;
    justify-items: stretch;
    width: 100%;
  }

  .account-actions > div {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

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