@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@600;700&family=Poppins:wght@400;500;600;700&display=swap');

/* =========================
   GLOBAL
========================== */

*{
  margin:0;
  padding:0;
  box-sizing:border-box;
}

html{
  scroll-behavior:smooth;
}

body{
  min-height:100vh;

  background:#e4e4e4;

  font-family:"Poppins", sans-serif;

  overflow-x:hidden;
  overflow-y:auto;

  padding:
    18px
    18px
    calc(120px + env(safe-area-inset-bottom));

  display:flex;
  flex-direction:column;
}

/* =========================
   PAGE CONTAINER
========================== */

.page-wrapper{
  width:100%;
  max-width:1400px;
  margin:0 auto;
}

/* =========================
   HEADER
========================== */

/* =========================
   BACK BUTTON
========================== */

.page-back-btn{
  width:48px;
  height:48px;

  border:none;
  outline:none;

  border-radius:50%;

  background:#ffffff;

  color:#111111;

  font-size:1.05rem;

  cursor:pointer;

  display:flex;
  justify-content:center;
  align-items:center;

  flex-shrink:0;

  margin-right:14px;

  box-shadow:
    0 4px 14px rgba(0,0,0,0.10);

  transition:0.3s ease;
}

.page-back-btn:hover{
  transform:translateY(-2px);
}

.page-back-btn:active{
  transform:scale(0.95);
}

.top-header{
  width:100%;

  display:flex;
  align-items:center;

  margin-bottom:24px;

  animation:fadeTop 0.8s ease;
}

.brand-section{
  display:flex;
  align-items:center;
  gap:12px;
}

/* LOGO */

.brand-logo{
  width:35px;
  height:35px;

  object-fit:contain;

  display:block;

  flex-shrink:0;
}

/* BRAND NAME */

.brand-section h1{
  font-family:"Playfair Display", serif;

  font-size:1.6rem;
  font-weight:700;

  color:#111111;

  letter-spacing:1px;

  line-height:1;

  text-transform:uppercase;

  text-shadow:
    0 3px 10px rgba(0,0,0,0.10);
}

/* =========================
   BILL SECTION
========================== */
.bill-section{

  width:100%;

  display:flex;
  justify-content:center;

  padding-bottom:120px;
}

.bill-card{

  width:100%;

  max-width:1600px;

  min-height:80vh;

  background:#ffffff;

  border-radius:20px;

  padding:24px;

  box-shadow:
  0 10px 30px rgba(0,0,0,.08);
}

.page-title{

  text-align:center;

  color:#0f88a7;

  font-size:1.6rem;

  margin-bottom:22px;
}

#billForm{

  display:flex;

  flex-direction:column;

  gap:16px;
}

#billForm input,
#billForm textarea,
#billForm select{

  width:100%;

  border:none;

  outline:none;

  background:#e0e0e0;

  border-radius:16px;

  padding:16px;

  font-size:15px;

  font-family:"Poppins",sans-serif;
}

#billForm textarea{

  resize:none;

  min-height:120px;
}

.form-row{
  display:flex;
  gap:16px;
  width:100%;
}

.form-group{
  flex:1;
  display:flex;
  flex-direction:column;
}

.form-group label{
  margin-bottom:6px;
  font-size:14px;
  font-weight:600;
  color:#111111;
}

/* Desktop */
@media (min-width:768px){

  .bill-card{
    width:min(100%,700px);
  }

  .form-row{
    flex-direction:row;
  }

}

/* Mobile */
@media (max-width:767px){

  .form-row{
    flex-direction:column;
    gap:16px;
  }

}

@media (min-width:1200px){

  .page-wrapper{
    max-width:1700px;
  }

  .bill-section{
    justify-content:center;
  }

  .bill-card{
    width:100%;
    max-width:1650px;

    min-height:85vh;

    padding:30px 35px;
  }

}

@media (min-width:1200px){

  .customer-row{

    display:grid;

    grid-template-columns:
      2fr
      1fr;

    gap:20px;
  }

}

.save-btn{

  height:56px;

  border:none;

  border-radius:16px;

  background:#0f88a7;

  color:#fff;

  font-size:16px;

  font-weight:600;

  cursor:pointer;

  transition:.3s;
}

.save-btn:hover{

  transform:translateY(-2px);
}

.save-btn:active{

  transform:scale(.98);
}

#toast{

  position:fixed;

  left:50%;

  bottom:110px;

  transform:
  translateX(-50%);

  background:#0f88a7;

  color:#fff;

  padding:14px 24px;

  border-radius:14px;

  font-weight:600;

  opacity:0;

  visibility:hidden;

  transition:.35s;

  z-index:999999;
}

#toast.show{

  opacity:1;

  visibility:visible;
}

@media(max-width:480px){

  .bill-card{

    padding:18px;
  }

  .page-title{

    font-size:1.4rem;
  }
}

/* =========================
   BOTTOM NAVIGATION
========================== */

.bottom-nav{
  position:fixed;

  bottom:calc(15px + env(safe-area-inset-bottom));

  left:50%;
  transform:translateX(-50%);

  width:min(92vw, 420px);
  height:78px;

  background:rgba(182,181,181,0.92);

  border-radius:28px;

  display:flex;
  justify-content:space-around;
  align-items:center;

  padding:0 10px;

  backdrop-filter:blur(12px);

  z-index:9999;

  box-shadow:
    0 10px 30px rgba(0,0,0,0.15);
}

.nav-item{
  position:relative;

  width:68px;
  height:68px;

  display:flex;
  justify-content:center;
  align-items:center;
}

.nav-link{
  position:relative;

  display:flex;
  flex-direction:column;
  justify-content:center;
  align-items:center;

  gap:5px;

  text-decoration:none;
  color:#ffffff;

  transition:0.35s ease;
}

.nav-link i{
  font-size:1.2rem;
  transition:0.35s ease;
}

.nav-text{
  position:absolute;

  bottom:-10px;

  font-size:0.7rem;

  opacity:0;

  transform:translateY(10px);

  transition:0.35s ease;

  color:#000000;
}

.nav-item.active .nav-link i{
  transform:translateY(-10px);

  color:#0f88a7;

  text-shadow:
    0 0 10px rgb(253, 210, 196),
    0 0 25px rgba(255, 187, 164, 1);
}

.nav-item.active .nav-text{
  opacity:1;
  transform:translateY(0);

  font-weight:600;
}

/* =========================
   ANIMATIONS
========================== */

@keyframes fadeTop{

  from{
    opacity:0;
    transform:translateY(-20px);
  }

  to{
    opacity:1;
    transform:translateY(0);
  }
}

.header-actions{
  display:flex;
  align-items:center;
  gap:12px;
}

.call-link{
  display:inline-flex;
  align-items:center;
  gap:8px;

  text-decoration:none;

  color:#0f88a7;

  font-weight:600;

  margin-top:4px;
}

.call-link i{
  font-size:13px;
}

.call-link:hover{
  opacity:.8;
}

/* =========================
   MOBILE
========================== */

@media (max-width:480px){

  body{
    padding:
      14px
      12px
      calc(120px + env(safe-area-inset-bottom));
  }

  .brand-section{
    gap:10px;
  }

  .brand-logo{
    width:35px;
    height:35px;
  }

  .brand-section h1{
    font-size:0.92rem;
    letter-spacing:0.5px;
  }

  .nav-text{
    font-size:0.62rem;
  }
}

/* =========================
   BILL TOAST
========================== */

.bill-toast{
  position:fixed;

  top:24px;
  right:24px;

  min-width:320px;
  max-width:90vw;

  background:#ffffff;

  border-radius:24px;

  padding:16px;

  display:flex;
  align-items:center;
  gap:14px;

  box-shadow:
    0 20px 50px rgba(0,0,0,0.18);

  z-index:99999;

  opacity:0;
  visibility:hidden;

  transform:
    translateX(120px)
    scale(0.9);

  transition:
    opacity 0.4s ease,
    transform 0.4s ease,
    visibility 0.4s ease;
}

/* SHOW */

.bill-toast.show{
  opacity:1;
  visibility:visible;

  transform:
    translateX(0)
    scale(1);
}

/* ICON */

.toast-icon{
  width:52px;
  height:52px;

  border-radius:18px;

  background:
    linear-gradient(
      135deg,
      #0f88a7,
      #39b8d8
    );

  display:flex;
  justify-content:center;
  align-items:center;

  flex-shrink:0;

  animation:toastPulse 1.2s infinite;
}

.toast-icon i{
  color:#ffffff;
  font-size:1.2rem;
}

/* CONTENT */

.toast-content{
  flex:1;
}

.toast-content h4{
  font-size:1rem;
  font-weight:700;

  color:#111111;

  margin-bottom:3px;
}

.toast-content p{
  font-size:0.9rem;
  color:#666666;
}

/* =========================
   POPUP TITLE
========================== */

#popupTitle{
  display:flex;
  align-items:center;
  gap:6px;

  flex-wrap:nowrap;

  font-size:1.2rem;
  font-weight:700;

  line-height:1.2;

  text-transform:capitalize;
}

/* ANIMATION */

@keyframes toastPulse{

  0%{
    transform:scale(1);
  }

  50%{
    transform:scale(1.08);
  }

  100%{
    transform:scale(1);
  }
}

/* MOBILE */

@media (max-width:480px){

  .bill-toast{
    top:16px;
    right:12px;
    left:12px;

    min-width:auto;

    padding:14px;

    border-radius:20px;
  }

  .toast-icon{
    width:46px;
    height:46px;

    border-radius:15px;
  }

  .toast-content h4{
    font-size:0.92rem;
  }

  .toast-content p{
    font-size:0.82rem;
  }

}

/* =========================
   HEADER ACTION BUTTON
========================== */

.top-header{
  justify-content:space-between;
}

.list-btn{
  width:48px;
  height:48px;

  border:none;
  outline:none;

  border-radius:50%;

  background:#ffffff;

  color:#0f88a7;

  font-size:1rem;

  cursor:pointer;

  flex-shrink:0;

  box-shadow:
  0 4px 14px rgba(0,0,0,.10);
}

/* =========================
   POPUP OVERLAY
========================== */

/* =========================
   POPUP CARD
========================== */

.bill-popup{

  width:100%;
  max-width:650px;

  background:#ffffff;

  border-radius:28px;

  overflow:hidden;

  box-shadow:
  0 25px 60px rgba(0,0,0,.25);

  animation:popupShow .3s ease;
}

@keyframes popupShow{

  from{
    opacity:0;
    transform:translateY(20px);
  }

  to{
    opacity:1;
    transform:translateY(0);
  }
}

.bill-popup-overlay{

  position:fixed;

  inset:0;

  background:
  rgba(0,0,0,.45);

  backdrop-filter:blur(6px);

  display:flex;

  justify-content:center;
  align-items:center;

  padding:16px;

  z-index:999999;

  opacity:0;
  visibility:hidden;

  transition:.35s;
}

.bill-popup-overlay.show{

  opacity:1;
  visibility:visible;
}

/* =========================
   POPUP
========================== */

.popup-header{

  background:#0f88a7;

  color:#ffffff;

  padding:18px 22px;

  display:flex;
  justify-content:space-between;
  align-items:center;
}

.popup-header h3{

  font-size:1.2rem;
}

.popup-close-btn{

  border:none;

  background:none;

  color:#ffffff;

  font-size:1.3rem;

  cursor:pointer;
}

/* =========================
   LIST
========================== */

.bill-list{

  padding:18px;

  overflow-y:auto;

  max-height:70vh;
}

.bill-item{

  background:#f8f8f8;

  border-radius:20px;

  padding:16px;

  margin-bottom:14px;

  border-left:
  5px solid #0f88a7;
}

.bill-date{

  font-size:12px;

  color:#0f88a7;

  font-weight:600;

  margin-bottom:8px;
}

.bill-name{

  font-size:16px;

  font-weight:700;

  color:#111;
}

.bill-mobile{

  margin-top:4px;

  color:#666;
}

.bill-address{
  display:flex;
  align-items:flex-start;
  gap:8px;

  margin-top:8px;

  color:#555555;

  line-height:1.5;

  word-break:break-word;
}

.bill-address i{
  color:#0f88a7;

  margin-top:3px;

  flex-shrink:0;

  font-size:14px;
}

.bill-address span{
  flex:1;
}

.delete-bill-btn{

  margin-top:12px;

  border:none;

  background:#ff4d4d;

  color:#fff;

  padding:10px 16px;

  border-radius:12px;

  cursor:pointer;

  font-weight:600;
}

.empty-bill{

  text-align:center;

  color:#666;

  padding:30px 0;
}

.bill-top{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:14px;
}

.bill-order{
  margin-top:8px;

  font-size:14px;

  color:#444444;

  line-height:1.5;

  word-break:break-word;
}

.delete-bill-btn{

  width:42px;
  height:42px;

  display:flex;
  justify-content:center;
  align-items:center;

  flex-shrink:0;

  border:none;

  border-radius:12px;

  background:#ff4d4d;

  color:#ffffff;

  cursor:pointer;

  font-size:15px;

  transition:.3s ease;
}

.delete-bill-btn:hover{
  transform:scale(1.05);
}

.delete-bill-btn i{
  pointer-events:none;
}

/* =========================
   PREVENT BACKGROUND SCROLL
========================== */

body.popup-open{
  overflow:hidden;
  position:fixed;
  width:100%;
}

.bill-info-row{
  display:flex;
  flex-wrap:wrap;
  gap:12px;
  margin-bottom:18px;

  padding:12px 14px;

  background:#f4f4f4;

  border-radius:14px;
}

.bill-info-item{
  display:flex;
  align-items:center;
  gap:4px;
}

.info-label{
  color:#111111;
  font-size:14px;
  font-weight:600;
}

.info-value{
  color:#777777;
  font-size:14px;
  font-weight:500;
}

@media(max-width:480px){

  .bill-info-row{
    gap:8px;
    padding:10px;
  }

  .info-label,
  .info-value{
    font-size:12px;
  }

}

/* =========================
   PRODUCTS
========================== */

.products-section{
  margin-top:10px;
}

.product-header,
.product-row{
  display:grid;

  grid-template-columns:
    60px
    1fr
    100px
    100px
    100px;

  gap:10px;
}

.product-header{
  margin-bottom:10px;

  font-size:13px;
  font-weight:600;

  color:#111111;
}

.product-row{
  margin-bottom:10px;
}

.product-row input{
  width:100%;
}

.add-product-btn{
  margin-top:10px;

  border:none;

  background:#0f88a7;

  color:#ffffff;

  padding:12px 16px;

  border-radius:12px;

  font-weight:600;

  cursor:pointer;
}

/* Tablet */

@media(max-width:991px){

  .product-header{
    display:none;
  }

  .product-row{
    display:flex;
    flex-wrap:wrap;

    background:#f4f4f4;

    padding:12px;

    border-radius:14px;
  }

  .product-row input{
    flex:1 1 45%;
  }

  .description{
    flex:1 1 100% !important;
  }
}

/* Mobile */

@media(max-width:480px){

  .product-row{
    gap:10px;
  }

  .product-row input{
    flex:1 1 100%;
  }

}

.billing-summary{

  margin-top:25px;

  display:grid;

  grid-template-columns:1fr 420px;

  gap:25px;

  align-items:start;
}

.amount-words-section{

  background:#f4f4f4;

  border-radius:16px;

  padding:16px;
}

.amount-words-section label{

  display:block;

  margin-bottom:10px;

  font-weight:600;

  color:#111;
}

.amount-words{

  min-height:120px;

  color:#555;

  font-size:15px;

  line-height:1.6;
}

.summary-section{

  display:flex;

  flex-direction:column;

  gap:10px;
}

.summary-row{

  display:grid;

  grid-template-columns:140px 1fr;

  gap:12px;

  align-items:center;
}

.summary-row label{

  font-weight:600;

  color:#111;
}

.summary-row input{

  height:45px;

  border:none;

  border-radius:12px;

  background:#e0e0e0;

  padding:0 12px;
}

.net-row{

  margin-top:8px;

  padding-top:8px;

  border-top:2px solid #ddd;
}

.net-row input{

  background:#0f88a7 !important;

  color:#fff;

  font-weight:700;
}

@media(max-width:768px){

  .billing-summary{

    grid-template-columns:1fr;
  }

  .summary-row{

    grid-template-columns:120px 1fr;
  }

  .amount-words{

    min-height:auto;
  }

}

.bill-products{
  margin-top:8px;
  color:#444;
  font-size:14px;

  display:flex;
  gap:8px;
  align-items:flex-start;

  line-height:1.5;
}

.bill-products i{
  color:#0f88a7;
  margin-top:3px;
}

.bill-netamount{
  margin-top:8px;

  display:inline-flex;
  align-items:center;
  gap:8px;

  padding:8px 12px;

  background:#e9f8fc;

  border-radius:10px;

  font-weight:700;
  color:#0f88a7;
}

.bill-netamount i{
  color:#0f88a7;
}

.bill-item{
  background:#f8f8f8;
  border-radius:20px;
  padding:16px;
  margin-bottom:14px;
  border-left:5px solid #0f88a7;
}

.bill-item-content{
  cursor:pointer;
}

.bill-item-content:hover{
  opacity:.95;
}

.bill-details{
  flex:1;
}

.bill-top-row{
  display:flex;
  justify-content:space-between;
  align-items:center;

  width:100%;

  margin-bottom:12px;
  padding-bottom:8px;

  font-size:12px;
  font-weight:600;

  gap:40px;   /* increase space */
}

.bill-second-row{
  display:flex;
  justify-content:space-between;
  align-items:center;

  width:100%;

  margin-bottom:12px;
  padding-bottom:8px;

  font-size:20px;
  font-weight:600;

  gap:40px;   /* increase space */
}

@media (max-width:480px){

  .bill-top-row{
    font-size:10px;
    gap:8px;
  }

}

.terms-section{
  margin-top:20px;
  padding-top:8px;
  border-top:1px solid #000;
}

.terms-line{
  text-align:center;
  font-size:10px;
  font-weight:600;
  margin-bottom:4px;
}

.delete-product-btn{
  width:40px;
  height:40px;

  border:none;
  border-radius:10px;

  background:#ff4d4d;
  color:#fff;

  cursor:pointer;

  display:flex;
  align-items:center;
  justify-content:center;
}

.delete-product-btn:hover{
  opacity:.9;
}