@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
  --ink: #252321;
  --muted: #756e66;
  --bg: #f4efe7;
  --surface: #fffdfa;
  --surface-2: #f9f4ec;
  --line: #e4d8c9;
  --brand: #0b8588;
  --brand-2: #12a29b;
  --wood: #8d6044;
  --charcoal: #242321;
  --gold: #d7ad6d;
  --green: #2f8c73;
  --danger: #d84c3f;
  --shadow: 0 18px 44px rgba(53, 45, 34, .11);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  font-family: Manrope, system-ui, -apple-system, Segoe UI, sans-serif;
  background:
    linear-gradient(90deg, rgba(255,255,255,.18) 1px, transparent 1px) 0 0 / 96px 96px,
    linear-gradient(0deg, rgba(255,255,255,.24) 1px, transparent 1px) 0 0 / 96px 96px,
    radial-gradient(circle at 72% 8%, rgba(11,133,136,.12), transparent 34%),
    linear-gradient(135deg, #fbf7ef 0%, #efe7da 48%, #f8f3eb 100%);
}

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

.sidebar {
  width: 286px;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 1030;
  overflow: auto;
  color: #fff;
  background:
    linear-gradient(180deg, rgba(21, 20, 19, .96), rgba(48, 39, 32, .98)),
    url("../img/showroom-hero.png") center / cover;
  box-shadow: 16px 0 42px rgba(36, 35, 33, .22);
}

.brand { padding: 23px 20px; border-bottom: 1px solid rgba(255,255,255,.09); }
.brand-logo {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: #fff9ed;
  font-weight: 900;
  letter-spacing: -.05em;
  background: rgba(255,255,255,.92);
  box-shadow: 0 14px 26px rgba(0,0,0,.25);
  overflow: hidden;
}
.brand-logo img {
  width: 88%;
  height: 88%;
  object-fit: contain;
  display: block;
}
.brand h5 { font-weight: 900; letter-spacing: -.03em; }
.side-caption {
  margin: 21px 18px 8px;
  color: rgba(255,255,255,.46);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.side-link {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  margin: 3px 12px;
  padding: 10px 14px;
  color: rgba(255,255,255,.72);
  text-decoration: none;
  font-weight: 800;
  border: 1px solid transparent;
  border-radius: 12px;
}
.side-link i { width: 20px; color: rgba(255,255,255,.56); }
.side-link:hover,
.side-link.active {
  color: #fff;
  background: rgba(11,133,136,.22);
  border-color: rgba(130,217,210,.22);
}
.side-link.active i,
.side-link:hover i { color: #83d9d2; }

.main { margin-left: 286px; width: calc(100% - 286px); }
.topbar {
  min-height: 78px;
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255,253,250,.88);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(228,216,201,.8);
}
.content { padding: 26px; }
.page-title { margin: 0; font-size: 27px; font-weight: 900; letter-spacing: -.035em; }
.subtle { color: var(--muted); }

.cardx {
  background: rgba(255,253,250,.92);
  border: 1px solid rgba(228,216,201,.92);
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.glass {
  background:
    linear-gradient(135deg, rgba(255,255,255,.88), rgba(246,238,226,.92)),
    linear-gradient(90deg, rgba(11,133,136,.08), transparent);
}
.btn { border-radius: 8px; font-weight: 800; }
.btn-primary { background: var(--charcoal); border-color: var(--charcoal); }
.btn-primary:hover { background: #0f8588; border-color: #0f8588; }
.btn-warning { background: var(--brand-2); border-color: var(--brand-2); color: #062b2d; }
.btn-light { background: #fff9f0; border-color: var(--line); color: var(--ink); }
.form-label { color: #5f574d; font-weight: 800; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.form-control,
.form-select {
  border-radius: 8px;
  border-color: #d8cabb;
  background-color: #fffdfa;
  padding: .72rem .92rem;
}
.form-control:focus,
.form-select:focus { border-color: var(--brand); box-shadow: 0 0 0 .2rem rgba(11,133,136,.16); }

.hero {
  min-height: 330px;
  display: flex;
  align-items: end;
  position: relative;
  overflow: hidden;
  padding: 28px;
  color: #fff;
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(22,21,20,.88) 0%, rgba(22,21,20,.54) 45%, rgba(22,21,20,.08) 100%),
    url("../img/showroom-hero.png") center / cover;
  box-shadow: var(--shadow);
}
.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 92px;
  background: linear-gradient(180deg, transparent, rgba(255,255,255,.2));
  pointer-events: none;
}
.hero > * { position: relative; z-index: 1; }
.hero h2 { max-width: 760px; font-weight: 900; letter-spacing: -.04em; }
.hero p { max-width: 680px; color: rgba(255,255,255,.86); }

.category-pill,
.finish-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 8px 8px 0;
  padding: 9px 13px;
  color: #113536;
  background: rgba(255,255,255,.88);
  border: 1px solid rgba(255,255,255,.72);
  border-radius: 999px;
  font-weight: 900;
  box-shadow: 0 10px 24px rgba(0,0,0,.08);
}
.finish-chip { color: var(--ink); background: #fff9ef; border-color: var(--line); }

.stat { padding: 18px; min-height: 148px; }
.stat-icon,
.cat-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  font-size: 22px;
  background: linear-gradient(135deg, var(--brand), var(--wood));
}
.stat h3 { margin: 13px 0 3px; font-size: 25px; font-weight: 900; letter-spacing: -.035em; }

.showroom-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
}
.category-card,
.product-card,
.tile-card {
  position: relative;
  overflow: hidden;
  min-height: 178px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 12px 30px rgba(53,45,34,.08);
}
.category-card::before,
.product-card::before,
.tile-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 6px;
  background: linear-gradient(90deg, var(--brand), var(--gold), var(--wood));
}
.category-card:hover,
.product-card:hover,
.tile-card:hover {
  transform: translateY(-2px);
  border-color: rgba(11,133,136,.55);
  box-shadow: 0 18px 40px rgba(53,45,34,.14);
}
.category-card h5,
.product-card h5 { font-weight: 900; letter-spacing: -.02em; }
.product-card .price { font-size: 22px; font-weight: 900; color: #0c7477; }

.table { vertical-align: middle; }
.table thead th {
  color: #645545;
  background: #f6ebdc;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .07em;
  text-transform: uppercase;
  white-space: nowrap;
}
.table tbody td { color: #332e29; }
.badge { border-radius: 999px; padding: .46rem .68rem; }
.badge-ok { background: #dff5ed; color: #1c694f; }
.badge-warn { background: #fff2c5; color: #85601d; }
.badge-blue { background: #dff4f5; color: #0b7376; }

.pos-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(310px, .85fr); gap: 22px; align-items: start; }
.summary-card { position: sticky; top: 98px; }
.room-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.room-tab {
  border: 1px solid var(--line);
  background: #fffdfa;
  color: var(--ink);
  padding: 9px 12px;
  border-radius: 999px;
  font-weight: 900;
}
.room-tab.active,
.room-tab:hover { background: #dff4f5; border-color: #99d6d4; color: #095f62; }
.chart {
  min-height: 270px;
  display: grid;
  gap: 12px;
  padding: 18px;
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(255,255,255,.5) 1px, transparent 1px) 0 0 / 64px 64px,
    linear-gradient(0deg, rgba(255,255,255,.55) 1px, transparent 1px) 0 0 / 64px 64px,
    #f6efe4;
}
.bar-row { display: grid; grid-template-columns: 150px 1fr 78px; gap: 12px; align-items: center; font-weight: 800; }
.bar-line { height: 12px; overflow: hidden; border-radius: 999px; background: #e8dccd; }
.bar-line span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--brand), var(--gold)); }

.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(90deg, rgba(22,21,20,.82), rgba(22,21,20,.48)),
    url("../img/showroom-hero.png") center / cover;
}
.login-card {
  width: 100%;
  max-width: 430px;
  padding: 34px;
  border-radius: 8px;
  background: rgba(255,253,250,.94);
  box-shadow: 0 35px 90px rgba(0,0,0,.28);
}
.mobile-toggle { display: none; }

.app-footer {
  padding-top: 18px;
  padding-bottom: 18px;
  color: #5f574d;
  border-top: 1px solid rgba(228,216,201,.82);
  background: rgba(255,253,250,.72);
}

.invoice-toolbar {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.invoice-sheet {
  max-width: 210mm;
  min-height: 297mm;
  margin: 0 auto;
  padding: 18mm;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.invoice-head {
  display: grid;
  grid-template-columns: 1fr 230px;
  gap: 24px;
  padding-bottom: 18px;
  border-bottom: 2px solid #242321;
}

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

.invoice-brand h2 {
  margin: 0;
  font-weight: 900;
  letter-spacing: -.035em;
}

.invoice-brand p,
.invoice-head address,
.invoice-parties p {
  margin: 0;
  color: var(--muted);
}

.invoice-head address {
  margin-top: 14px;
  font-style: normal;
  line-height: 1.7;
}

.invoice-meta {
  display: grid;
  align-content: start;
  gap: 7px;
  padding: 16px;
  color: #fff;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--charcoal), var(--brand));
}

.invoice-meta span,
.invoice-kicker {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.invoice-meta strong {
  font-size: 25px;
}

.invoice-parties {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin: 22px 0;
}

.invoice-parties > div,
.invoice-payment {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdfa;
}

.invoice-parties h5 {
  margin: 8px 0;
  font-weight: 900;
}

.invoice-table-wrap {
  border: 1px solid var(--line);
  border-radius: 8px;
}

.invoice-table thead th {
  color: #fff;
  background: #242321;
}

.invoice-bottom {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 24px;
  margin-top: 22px;
}

.invoice-terms ul {
  margin: 8px 0 18px;
  padding-left: 18px;
  color: var(--muted);
}

.invoice-total-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.invoice-total-grand {
  margin-top: 6px;
  padding: 14px;
  color: #fff;
  border: 0;
  border-radius: 8px;
  background: var(--charcoal);
}

.invoice-amount-words {
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.invoice-signatures {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 36px;
  margin-top: 54px;
}

.invoice-signatures div {
  min-height: 72px;
  display: flex;
  align-items: end;
  justify-content: center;
  border-top: 1px solid var(--ink);
  color: var(--muted);
  font-weight: 800;
}

.barcode-grid {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.barcode-label {
  display: grid;
  gap: 7px;
  min-height: 145px;
  padding: 12px;
  text-align: center;
  border: 1px dashed #9f917f;
  border-radius: 8px;
  background: #fff;
}

.barcode-label span,
.barcode-label small {
  color: var(--muted);
}

.barcode-bars {
  height: 42px;
  background:
    repeating-linear-gradient(90deg, #1f1f1f 0 2px, transparent 2px 4px, #1f1f1f 4px 7px, transparent 7px 10px);
}

@media (max-width: 991px) {
  .sidebar { transform: translateX(-100%); transition: .25s ease; }
  .sidebar.show { transform: none; }
  .main { margin-left: 0; width: 100%; }
  .mobile-toggle { display: inline-flex; }
  .pos-grid { grid-template-columns: 1fr; }
  .summary-card { position: static; }
  .content { padding: 18px; }
  .page-title { font-size: 23px; }
  .hero { min-height: 300px; padding: 20px; }
  .invoice-sheet { padding: 20px; }
  .invoice-head,
  .invoice-parties,
  .invoice-bottom { grid-template-columns: 1fr; }
}

@media (max-width: 575px) {
  .topbar { padding: 12px 0; }
  .content { padding: 14px; }
  .hero { min-height: 380px; align-items: end; }
  .stat h3 { font-size: 20px; }
  .table-responsive { font-size: 13px; }
  .bar-row { grid-template-columns: 1fr; gap: 6px; }
  .invoice-toolbar { justify-content: stretch; flex-wrap: wrap; }
  .invoice-toolbar .btn { flex: 1 1 130px; }
  .invoice-sheet { border-radius: 0; }
  .invoice-signatures { grid-template-columns: 1fr; }
}

@media print {
  @page { size: A4; margin: 10mm; }
  body { background: #fff; }
  .sidebar,
  .topbar,
  .app-footer,
  .invoice-toolbar { display: none !important; }
  .app { display: block; min-height: auto; }
  .main { width: 100%; margin: 0; }
  .content { padding: 0; }
  .invoice-sheet {
    width: 100%;
    max-width: none;
    min-height: auto;
    padding: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }
  .invoice-table-wrap { overflow: visible; }
  .table { font-size: 12px; }
  .invoice-signatures { break-inside: avoid; }
  .barcode-label { break-inside: avoid; box-shadow: none; }
}
