:root {
  --blue: #0081c9;
  --green: #4caf2f;
  --ink: #1a1a1a;
  --muted: #5a5a5a;
  --line: rgba(0, 129, 201, 0.18);
  --white: #ffffff;
  --glass: rgba(255, 255, 255, 0.82);
  --shadow: 0 12px 28px rgba(0, 80, 140, 0.08);
  --radius: 16px;
  --tap: 48px;
  --font: Arial, Helvetica, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  color: var(--ink);
  font-family: var(--font);
}

body {
  background: #f4fbff url("../public/assets/bg.png") center / cover fixed no-repeat;
}

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

.auth-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-card {
  width: min(420px, 100%);
  padding: 28px 24px;
  text-align: center;
}

.auth-logo {
  width: 120px;
  height: 120px;
  object-fit: contain;
  margin: 0 auto 10px;
  display: block;
}

.company-name {
  margin: 0;
  color: var(--blue);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.hero-title {
  margin: 6px 0 10px;
  color: var(--green);
  font-size: clamp(28px, 6vw, 42px);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.1;
}

.page-hero {
  text-align: center;
  margin: 0 0 22px;
}

.bill-hero {
  font-size: 22px;
  margin: 4px 0 8px;
}

.discount-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.discount-row input {
  width: 100px;
  min-height: 40px;
}

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

.auth-card .fields {
  text-align: left;
}

.auth-card .btn {
  width: 100%;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 18px;
  background: rgba(255, 255, 255, 0.88);
  border-bottom: 1px solid var(--line);
}

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

.brand img {
  width: 58px;
  height: 58px;
  object-fit: contain;
}

.brand-copy strong {
  display: block;
  color: var(--blue);
  letter-spacing: 0.04em;
  font-size: 12px;
}

.brand-copy span {
  display: block;
  color: var(--green);
  font-size: 11px;
}

.nav {
  display: flex;
  gap: 6px;
  align-items: center;
}

.nav a,
.nav button {
  border: 0;
  background: transparent;
  color: var(--ink);
  padding: 10px 14px;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  font: inherit;
}

.nav a.active,
.nav a:hover,
.nav button.active,
.nav button:hover {
  background: rgba(0, 129, 201, 0.1);
  color: var(--blue);
}

.wrap {
  width: min(1180px, calc(100% - 28px));
  margin: 22px auto 80px;
}

.panel {
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

h1,
h2,
h3 {
  font-family: var(--font);
  font-weight: 700;
  margin: 0 0 8px;
  color: var(--blue);
}

.lede {
  margin: 0 0 18px;
  color: var(--muted);
}

.grid-2 {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 18px;
  align-items: start;
}

.section {
  padding: 22px;
}

.fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

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

.field.full {
  grid-column: 1 / -1;
}

label {
  font-size: 12px;
  color: var(--blue);
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: var(--tap);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
}

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

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(0, 129, 201, 0.28);
  border-color: var(--blue);
}

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

.chip {
  border: 1px solid var(--line);
  background: white;
  color: var(--blue);
  border-radius: 8px;
  padding: 8px 14px;
  cursor: pointer;
}

.chip.active {
  background: var(--blue);
  color: white;
  border-color: var(--blue);
}

.products {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.product {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.9);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.product h3 {
  font-size: 16px;
  margin: 0;
  color: var(--ink);
}

.cat {
  font-size: 11px;
  color: var(--green);
  font-weight: 700;
}

.sizes {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.size {
  border: 1px solid var(--line);
  background: white;
  border-radius: 8px;
  padding: 7px 8px;
  cursor: pointer;
  font-size: 12px;
}

.size:hover,
.size.active {
  border-color: var(--green);
  background: rgba(76, 175, 47, 0.1);
}

.row-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.qty {
  width: 72px;
  min-height: 42px;
}

.btn {
  border: 0;
  border-radius: 8px;
  min-height: 44px;
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 700;
}

.btn-green {
  background: var(--green);
  color: white;
}

.btn-ghost {
  background: transparent;
  color: var(--blue);
  border: 1px solid var(--line);
}

.btn-danger {
  background: transparent;
  color: #b42318;
}

.bill {
  position: sticky;
  top: 88px;
  overflow: hidden;
  background: url("../public/assets/bg.png") center / cover no-repeat, var(--white);
}

.bill-head {
  padding: 18px 20px 8px;
  text-align: center;
}

.bill-logo {
  width: 118px;
  height: 118px;
  object-fit: contain;
  margin: 0 auto 8px;
  display: block;
}

.bill-head h2 {
  margin: 0;
  color: var(--blue);
  font-size: 18px;
}

.bill-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.bill-body {
  padding: 8px 0 18px;
}

.line {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  align-items: center;
  padding: 10px 20px;
  border-bottom: 1px solid var(--line);
}

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

.totals {
  padding: 14px 20px 0;
  display: grid;
  gap: 8px;
}

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

.grand {
  font-size: 20px;
  color: var(--blue);
  padding-top: 8px;
  border-top: 1px dashed var(--line);
}

.bill-contact {
  margin: 16px 20px 0;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}

.bill-contact strong {
  display: block;
  color: var(--green);
  margin-bottom: 4px;
  font-size: 11px;
}

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

.empty {
  padding: 28px 20px;
  color: var(--muted);
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}

.stat {
  padding: 16px;
}

.stat b {
  display: block;
  font-size: 24px;
  color: var(--blue);
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th,
td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th {
  font-size: 12px;
  color: var(--blue);
}

.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--blue);
  color: white;
  padding: 12px 18px;
  border-radius: 8px;
  opacity: 0;
  pointer-events: none;
  transition: 0.2s ease;
}

.toast.show {
  opacity: 1;
}

.print-only {
  display: none !important;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.pin-gate {
  max-width: 420px;
  margin: 60px auto;
  padding: 28px;
}

.mix {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 16px;
}

.mix span {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 13px;
}

.product-admin {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 12px;
  background: rgba(255, 255, 255, 0.9);
}

.product-admin-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 10px;
}

.product-admin h3 {
  margin: 0;
  color: var(--ink);
  font-size: 16px;
}

.size-admin-list {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}

.size-admin-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.add-size-form {
  grid-template-columns: 1fr 1fr auto;
  margin-top: 8px;
}

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

@media (max-width: 900px) {
  .grid-2,
  .fields,
  .stats {
    grid-template-columns: 1fr;
  }

  .bill {
    position: static;
  }

  .brand-copy span {
    display: none;
  }
}

@media print {
  .topbar,
  .nav,
  .no-print,
  .auth-screen,
  .page-hero,
  .grid-2 > div:first-child {
    display: none !important;
  }

  .print-only {
    display: flex !important;
  }

  body {
    background: url("../public/assets/bg.png") center / cover no-repeat;
  }

  .wrap {
    width: 100%;
    margin: 0;
  }

  .bill {
    box-shadow: none;
    border: 0;
    position: static;
    background: url("../public/assets/bg.png") center / cover no-repeat, white;
  }
}
