/* css/style.css
   Fully updated stylesheet for Hiba Collections POS
   Includes receipt header titles (Item | Qty | Price), refined printable receipt styling,
   header gradient and upgraded colorful button styles.
*/

/* ---------- Theme variables ---------- */
:root{
  --bg: #f0f8ff; /* base gradient start */
  --card-bg: rgba(255,255,255,0.98);
  --muted: #6c757d;
  --accent-1: #ff7a7a;
  --accent-2: #7ad3ff;
  --accent-3: #9bffb0;
  --primary: #2b6ef6;
  --border: rgba(10,30,60,0.04);
  --radius: 10px;
  --text: #111827;
  --mono-font: "Courier New", Courier, monospace;
}

/* ---------- Global ---------- */
*{box-sizing:border-box}
html,body{height:100%}
body{
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  margin:0;
  /* page background: a soft multi-stop gradient */
  background: linear-gradient(135deg, #f0f8ff 0%, #eef9f3 35%, #fff8f2 100%);
  background-attachment: fixed;
  color:var(--text);
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
  line-height:1.4;
}

/* ---------- Container adjustments ---------- */
/* Keep the main container transparent so the page gradient shows through */
.container{
  max-width:1140px;
  background: transparent;
  padding-left: 18px;
  padding-right: 18px;
}

/* ---------- Navbar (default) ---------- */
.navbar{
  border-bottom: 0;
  background: transparent;
  padding-top: 8px;
  padding-bottom: 8px;
}
.navbar-logo{
  height:36px;
  width:auto;
  border-radius:4px;
}

/* ---------- Navbar: gradient variant (use .navbar-gradient on <nav>) ---------- */
/* The header uses a clean vibrant gradient with translucent buttons */
.navbar-gradient {
  background: linear-gradient(90deg, #50c9c3 0%, #96deda 30%, #e6f7ff 60%);
  border-bottom: none;
  box-shadow: 0 8px 24px rgba(14,38,63,0.06);
  padding-top: 10px;
  padding-bottom: 10px;
  backdrop-filter: blur(4px);
}

/* Brand/logo sizing for gradient header */
.navbar-gradient .navbar-logo{
  height:36px;
  width:auto;
  object-fit:contain;
  margin-right:8px;
}

/* Signed-in label styling (top-right) */
.header-signed-in {
  color: #0b2340;
  font-size: 0.95rem;
  margin-right: 12px;
}
.header-signed-in strong {
  color: #062235;
  font-weight:700;
}

/* Make the action buttons in the header small, rounded and with soft translucent look */
.navbar-gradient .btn {
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 0.9rem;
  box-shadow: 0 6px 14px rgba(12,30,50,0.06);
  background: rgba(255,255,255,0.92);
  border: 1px solid rgba(6,30,45,0.06);
  color: rgba(6,30,45,0.95);
}

/* Make the danger (logout) button stronger */
.navbar-gradient .btn-danger {
  background: linear-gradient(180deg,#ff5a6a,#e23b4d);
  color: #fff;
  border: 1px solid rgba(0,0,0,0.06);
  box-shadow: 0 6px 16px rgba(226,59,77,0.14);
}

/* Slightly softer outline button colors to match the gradient */
.navbar-gradient .btn-outline-primary {
  color: #0b66ff;
  border-color: rgba(11,102,255,0.18);
  background: linear-gradient(180deg, rgba(11,102,255,0.03), rgba(11,102,255,0.01));
}
.navbar-gradient .btn-outline-info {
  color: #0aa3d6;
  border-color: rgba(10,163,214,0.14);
}
.navbar-gradient .btn-outline-success {
  color: #1fa54a;
  border-color: rgba(31,165,74,0.12);
}
.navbar-gradient .btn-outline-secondary {
  color: #4b5563;
  border-color: rgba(75,85,99,0.08);
}

/* Tighten spacing on small screens for gradient header */
@media (max-width: 768px) {
  .navbar-gradient .btn {
    padding: 5px 8px;
    font-size: 0.82rem;
  }
  .navbar-brand span { font-size: 1rem; }
  /* optionally hide text on very small screens */
  .header-signed-in { display: none; }
}

/* ---------- Cards ---------- */
/* Use a slightly translucent white card so the gradient peeks through softly */
.card{
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 2px);
  box-shadow: 0 6px 18px rgba(20,30,70,0.03);
}

/* header title small spacing */
.card .card-header{
  font-weight:600;
  background:transparent;
  border-bottom: none;
}

/* ---------- Product grid & cards ---------- */
.product-card{
  cursor:pointer;
  transition: transform .12s ease, box-shadow .12s ease;
  border-radius:8px;
  overflow:hidden;
  min-height:74px;
  display:flex;
  align-items:center;
}
.product-card:hover{
  transform: translateY(-6px);
  box-shadow: 0 12px 30px rgba(20,30,70,0.08);
}
.product-thumb{
  width:56px;
  height:56px;
  object-fit:cover;
  border-radius:6px;
  flex-shrink:0;
  border:1px solid #f0f3f7;
}

/* product meta */
.product-card .fw-bold{font-size:0.95rem}
.product-card .small{font-size:0.82rem;color:var(--muted)}

/* ---------- Settings table ---------- */
.table.align-middle th, .table.align-middle td{
  vertical-align: middle;
}
.table-responsive{ background:transparent; }
.table td input.form-control, .table td textarea.form-control{
  border-radius:6px;
  border: 1px solid #e6ecf5;
  padding:.55rem .7rem;
  box-shadow:none;
}
.table td textarea.form-control{ min-height:48px; resize:vertical; }

/* Save / Cancel buttons area */
.btn-primary{ background: linear-gradient(90deg,var(--primary), #1b56d6); border: none; color:#fff; box-shadow: 0 8px 22px rgba(43,110,246,0.12); }
.btn-outline-secondary{ border-radius:8px; }

/* ---------- Receipt (thermal roll) ---------- */
.receipt{
  background:#fff;
  margin: 0 auto;
  padding: 14px 18px;
  color: #111;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 14px;
  border: 1px solid #eee;
  border-radius:6px;
  box-shadow: 0 6px 20px rgba(15,25,60,0.03);
}

/* Header */
.receipt .receipt-logo{
  max-width: 160px;
  width: 100%;
  height: auto;
  margin: 0 auto 8px;
  display:block;
}
.receipt .receipt-header { text-align:center; padding-bottom:8px; }
.receipt .receipt-header h5{ margin:6px 0; font-size:16px; font-weight:700; }
.receipt .receipt-header .small{ color:var(--muted); font-size:12px; }

/* Order / date row */
.receipt .receipt-meta {
  display:flex;
  justify-content:space-between;
  align-items:center;
  font-size:13px;
  color:#333;
  margin-top:6px;
}

/* Items header (Item | Qty | Price) */
.receipt-items-header {
  display:flex;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  margin-top:10px;
  margin-bottom:6px;
  font-size: 13px;
  color: #333;
  font-weight:700;
}
.receipt-items { margin-top:4px; }

/* Item rows */
.item-row{
  display:flex;
  align-items:center;
  padding:8px 0;
  border-bottom: 1px dashed rgba(0,0,0,0.06);
}
.item-row:last-child{ border-bottom:none; padding-bottom:0; }
.item-row > div { vertical-align: middle; }
.item-row .small { color: #666; font-size: 12px; margin-top:3px; }

/* Column widths: left flex, qty fixed, price fixed */
.item-row .col-item { flex:1; padding-right:8px; }
.item-row .col-qty { width:48px; text-align:center; }
.item-row .col-price { width:82px; text-align:right; font-variant-numeric: tabular-nums; }

/* Totals */
.receipt-totals{ font-size:15px; margin-top:8px; }
.receipt-totals .fw-bold{ font-weight:700; }
.receipt .receipt-footer{ font-size:13px; color:var(--muted); margin-top:10px; }

/* Emphasize total */
.receipt .total-amount { font-weight:800; font-size:1.05rem; }

/* Barcode area */
.receipt .receipt-barcode { text-align:center; margin-top:10px; }
.receipt .receipt-barcode svg { max-width:100%; height:60px; }

/* small text helper */
.small-muted{ font-size:12px; color:var(--muted) }

/* ---------- Print styles: print only the receipt ---------- */
@media print{
  /* Hide everything except the receipt */
  body * { visibility: hidden !important; }
  #receipt, #receipt * { visibility: visible !important; }
  #receipt { position: absolute; left: 0; top: 0; box-shadow:none; }
  /* Remove page margins for thermal-like output; printer margins still apply */
  @page { margin: 4mm; size: auto; }
  /* Use mono numbers for alignment on print */
  .item-row .col-price, .receipt-totals { font-family: var(--mono-font), monospace; }
  /* Slightly larger text on print for clarity */
  #receipt { font-size: 15px; padding: 10px; }
}

/* ---------- Login page (colorful) ---------- */
.login-bg{
  min-height:100vh;
  display:flex;
  align-items:center;
  justify-content:center;
  background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 35%, #c3f0ff 100%);
  padding: 40px 18px;
}

.login-card{
  width:100%;
  max-width:480px;
  border-radius:12px;
  overflow:hidden;
  border:none;
  box-shadow: 0 18px 50px rgba(10,30,60,0.12);
}

.login-brand{
  background: linear-gradient(90deg,#6dd5ed 0%,#2193b0 100%);
  color:#fff;
  text-align:center;
  padding:18px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px;
}
.login-brand img{ height:48px; width:auto; border-radius:6px; border:1px solid rgba(255,255,255,0.08); }

.field-label{ font-weight:600; font-size:0.9rem; }
.show-pass-note{ font-size:0.85rem; color:#666; margin-top:6px; }

/* Login form body */
.login-card .card-body{ background: linear-gradient(180deg,#fff 0%, #fbfdff 100%); padding:26px; }
.login-card .btn-primary{ background: linear-gradient(90deg,#6f5af8,#2b6ef6); border:none; }

/* ---------- Dashboard accents ---------- */
.card-accent {
  position:relative;
  overflow:visible;
}
.card-accent .card-body{
  padding:18px;
}
.card-accent .small{ color:var(--muted); }
.kpi{
  font-size:1.6rem;
  font-weight:700;
  margin-top:6px;
}

/* accent strips using pseudo element for cards */
.card-accent.accent-1::before,
.card-accent.accent-2::before,
.card-accent.accent-3::before{
  content: "";
  position:absolute;
  left:0;
  top:0;
  bottom:0;
  width:6px;
  border-top-left-radius:8px;
  border-bottom-left-radius:8px;
}
.card-accent.accent-1::before{ background: linear-gradient(180deg,#ff8a8a,#ff5a5a); }
.card-accent.accent-2::before{ background: linear-gradient(180deg,#7ad3ff,#3fb4ff); }
.card-accent.accent-3::before{ background: linear-gradient(180deg,#b1ffb2,#6fe08a); }

/* Recent sales list */
.list-group-item .fw-bold{ font-size:0.95rem; }
.list-group-item .small{ color:var(--muted) }

/* Chart area */
canvas{ max-width:100%; }

/* ---------- Button visual upgrade (append to end of css/style.css) ---------- */

/* Smooth transitions for all buttons */
.btn {
  transition: transform 120ms ease, box-shadow 180ms ease, background 180ms ease, color 120ms ease;
  will-change: transform, box-shadow;
  border-radius: 12px; /* slightly larger pill */
  padding: 0.45rem 0.85rem;
  font-weight: 600;
  letter-spacing: 0.1px;
}

/* Small variant */
.btn-sm {
  padding: 0.32rem 0.6rem;
  border-radius: 10px;
  font-size: 0.86rem;
}

/* Primary (solid) */
.btn-primary {
  background: linear-gradient(90deg,#4f8ef7 0%, #2b6ef6 100%);
  color: #fff;
  border: 0;
  box-shadow: 0 6px 18px rgba(43,110,246,0.16);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(43,110,246,0.18); }
.btn-primary:active { transform: translateY(0); box-shadow: 0 6px 14px rgba(43,110,246,0.14); }

/* Info (solid) */
.btn-info {
  background: linear-gradient(90deg,#32c1e6 0%, #0aa3d6 100%);
  color: #fff;
  border: 0;
  box-shadow: 0 6px 18px rgba(10,163,214,0.14);
}
.btn-info:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(10,163,214,0.16); }

/* Success (solid) */
.btn-success {
  background: linear-gradient(90deg,#6fe08a 0%, #2fb85a 100%);
  color: #fff;
  border: 0;
  box-shadow: 0 6px 18px rgba(47,184,90,0.12);
}
.btn-success:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(47,184,90,0.14); }

/* Danger (Logout) - more vivid */
.btn-danger {
  background: linear-gradient(180deg,#ff6b7a 0%, #e23b4d 100%);
  color: #fff;
  border: 0;
  box-shadow: 0 8px 20px rgba(226,59,77,0.18);
}
.btn-danger:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(226,59,77,0.20); }

/* Outlined variants - translucent white look on gradient header, then color on hover */
.btn-outline-primary {
  background: linear-gradient(180deg, rgba(255,255,255,0.84), rgba(255,255,255,0.78));
  color: #0b66ff;
  border: 1px solid rgba(11,102,255,0.18);
  box-shadow: 0 6px 14px rgba(11,102,255,0.04);
}
.btn-outline-primary:hover {
  background: linear-gradient(90deg,#4f8ef7 0%, #2b6ef6 100%);
  color: #fff;
  border: 0;
  box-shadow: 0 10px 26px rgba(43,110,246,0.16);
}

/* Outline info */
.btn-outline-info {
  background: linear-gradient(180deg, rgba(255,255,255,0.86), rgba(255,255,255,0.80));
  color: #0aa3d6; border: 1px solid rgba(10,163,214,0.14);
}
.btn-outline-info:hover {
  background: linear-gradient(90deg,#32c1e6 0%, #0aa3d6 100%); color:#fff; border:0; box-shadow: 0 10px 26px rgba(10,163,214,0.14);
}

/* Outline success */
.btn-outline-success {
  background: linear-gradient(180deg, rgba(255,255,255,0.86), rgba(255,255,255,0.80));
  color: #1fa54a; border: 1px solid rgba(31,165,74,0.12);
}
.btn-outline-success:hover {
  background: linear-gradient(90deg,#6fe08a 0%, #2fb85a 100%); color:#fff; border:0; box-shadow: 0 10px 26px rgba(47,184,90,0.12);
}

/* Outline secondary (subtle) */
.btn-outline-secondary {
  background: linear-gradient(180deg, rgba(255,255,255,0.94), rgba(255,255,255,0.90));
  color: #374151; border: 1px solid rgba(55,65,81,0.06);
}
.btn-outline-secondary:hover {
  background: linear-gradient(90deg,#f2f6f9 0%, #eef6ff 100%); color:#0b2340; border:1px solid rgba(6,30,45,0.06); box-shadow: 0 8px 18px rgba(6,30,45,0.04);
}

/* Focus state for accessibility */
.btn:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(43,110,246,0.18);
}

/* Tiny icon spacing when you use icons inside buttons */
.btn .bi {
  margin-right: 6px;
  vertical-align: middle;
  opacity: 0.95;
}

/* Grouped header quick-actions: small gap */
.header-quick-actions { display:flex; gap:8px; align-items:center; }

/* Optional subtle badge on active nav button */
.navbar .btn.active, .navbar .btn:active {
  transform: translateY(-1px);
}

/* Ensure drop shadows look good on the page gradient background */
.card, .list-group-item {
  background: rgba(255,255,255,0.98);
}

/* Mobile: slightly smaller buttons to fit */
@media (max-width: 520px) {
  .btn { padding: 0.28rem 0.5rem; font-size: 0.82rem; border-radius: 10px; }
  .navbar-gradient .btn { box-shadow: 0 4px 10px rgba(12,30,50,0.04); }
}

/* ---------- Utility helpers ---------- */
.text-muted-small{ color:var(--muted); font-size:0.85rem; }

/* ---------- Responsive: tweaks ---------- */
@media (max-width: 991px){
  .product-thumb{ width:48px; height:48px; }
  .receipt{ font-size:13px; }
}
@media (max-width: 768px){
  .product-card{ min-height:68px; }
  .receipt { padding:10px; }
  .login-card{ max-width:420px; }
}

/* ---------- Settings layout polish ---------- */
.table.align-middle thead th{
  background: transparent;
  font-weight:600;
  border-bottom: 1px solid rgba(0,0,0,0.03);
}
.table td .form-control{
  background: #fff;
}

/* Focus states */
.form-control:focus{
  box-shadow: 0 0 0 0.12rem rgba(43,110,246,0.12);
  border-color: rgba(43,110,246,0.5);
}

/* Accessibility helper */
.sr-only{
  position: absolute !important;
  height: 1px; width: 1px;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
  white-space: nowrap;
}