:root {
  --brand-primary: #1e7a3c;
  --brand-primary-dark: #145a2c;
  --brand-accent: #f5a623;
  --brand-danger: #d9534f;
  --sidebar-width: 240px;
  --topbar-height: 56px;
}

body {
  background: #f4f6f5;
  font-family: 'Segoe UI', Roboto, Arial, sans-serif;
}

.app-topbar {
  background: linear-gradient(90deg, var(--brand-primary-dark), var(--brand-primary));
  height: var(--topbar-height);
  position: sticky;
  top: 0;
  z-index: 1030;
}

.app-body {
  display: flex;
  min-height: calc(100vh - var(--topbar-height));
}

.app-sidebar {
  width: var(--sidebar-width);
  background: #ffffff;
  border-right: 1px solid #e3e6e5;
  padding: 1rem 0;
  flex-shrink: 0;
}

.app-sidebar .nav-link {
  color: #33413b;
  padding: 0.55rem 1.25rem;
  font-size: 0.92rem;
  border-left: 3px solid transparent;
}

.app-sidebar .nav-link i { width: 20px; display: inline-block; margin-right: 6px; }

.app-sidebar .nav-link:hover {
  background: #eef7f0;
  color: var(--brand-primary-dark);
}

.app-sidebar .nav-link.active {
  background: #eef7f0;
  color: var(--brand-primary-dark);
  border-left-color: var(--brand-primary);
  font-weight: 600;
}

.nav-section-title {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #9aa5a0;
  padding: 1rem 1.25rem 0.35rem;
}

.app-content {
  flex: 1;
  padding: 0;
  min-width: 0;
}

.page-inner { padding: 1.25rem; }

.btn-brand {
  background-color: var(--brand-primary);
  border-color: var(--brand-primary);
  color: #fff;
}
.btn-brand:hover { background-color: var(--brand-primary-dark); border-color: var(--brand-primary-dark); color: #fff; }

.card-stat {
  border: none;
  border-radius: 12px;
  color: #fff;
  box-shadow: 0 2px 10px rgba(0,0,0,.08);
}
.card-stat.green { background: linear-gradient(135deg,#1e7a3c,#2fa858); }
.card-stat.orange { background: linear-gradient(135deg,#e08e0b,#f5a623); }
.card-stat.blue { background: linear-gradient(135deg,#1a5f9e,#2f8bd9); }
.card-stat.red { background: linear-gradient(135deg,#a83232,#d9534f); }

.table-card { background:#fff; border-radius: 12px; box-shadow: 0 2px 10px rgba(0,0,0,.05); }

/* ---------------- POS SCREEN ---------------- */
.pos-wrapper { display: flex; height: calc(100vh - var(--topbar-height)); }
.pos-products { flex: 1 1 62%; overflow-y: auto; padding: 1rem; }
.pos-cart { flex: 1 1 38%; max-width: 460px; background: #fff; border-left: 1px solid #e3e6e5; display: flex; flex-direction: column; }
.pos-cart-header { padding: 1rem; border-bottom: 1px solid #eee; }
.pos-cart-items { flex: 1; overflow-y: auto; padding: 0.5rem 1rem; }
.pos-cart-footer { border-top: 1px solid #eee; padding: 1rem; background: #fbfcfb; }

.product-tile {
  background: #fff;
  border-radius: 10px;
  border: 1px solid #e6e9e7;
  padding: 0.75rem;
  cursor: pointer;
  transition: box-shadow .15s, transform .1s;
  height: 100%;
}
.product-tile:hover { box-shadow: 0 4px 14px rgba(0,0,0,.12); transform: translateY(-2px); }
.product-tile .p-name { font-weight: 600; font-size: 0.85rem; min-height: 2.4em; }
.product-tile .p-price { color: var(--brand-primary-dark); font-weight: 700; }
.product-tile .p-stock { font-size: 0.72rem; }
.product-tile.low-stock { border-color: #f0c36d; }
.product-tile.out-of-stock { opacity: 0.5; cursor: not-allowed; }

.cart-line-item { border-bottom: 1px dashed #eee; padding: 0.5rem 0; }
.qty-control button { width: 26px; height: 26px; padding: 0; line-height: 1; }

.receipt-box { font-family: 'Courier New', monospace; width: 300px; margin: 0 auto; font-size: 0.82rem; }
.receipt-box hr { border-top: 1px dashed #333; }

@media (max-width: 767.98px) {
  .app-sidebar {
    position: fixed;
    top: var(--topbar-height);
    left: -260px;
    height: calc(100vh - var(--topbar-height));
    z-index: 1040;
    transition: left .2s ease;
    overflow-y: auto;
  }
  .app-sidebar.show { left: 0; }
  .pos-wrapper { flex-direction: column; height: auto; }
  .pos-cart { max-width: 100%; }
}

@media print {
  .no-print { display: none !important; }
  body { background: #fff; }
}
