/* =============================================
   DairyFlow — Consolidated Stylesheet
   All CSS from dashboard, customers, deliveries, bills
   ============================================= */

/* ── CSS Variables ── */
:root {
  --cream: #FDFAF5;
  --ink: #1A1A2E;
  --slate: #4A5568;
  --accent: #2563EB;
  --accent-light: #EFF6FF;
  --milk-white: #FFFFFF;
  --border: #E2E8F0;
  --success: #059669;
  --danger: #DC2626;
  --warning: #D97706;
  --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 4px 16px rgba(0, 0, 0, 0.04);
}

/* ── Reset ── */
* {
  box-sizing: border-box;
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--cream);
  color: var(--ink);
  min-height: 100vh;
  margin: 0;
}


/* =============================================
   NAVIGATION
   ============================================= */
.dairy-nav {
  background: var(--ink);
  padding: 0 2rem;
  height: 56px;

  display: flex;
  align-items: center;
  justify-content: space-between;

  box-sizing: border-box;
}

.dairy-nav .brand {
  font-family: 'Inter', sans-serif;
  font-size: 1.4rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.04em;
  line-height: 1;
}

.dairy-nav .brand span {
  color: #93C5FD;
}

.dairy-nav .nav-links a {
  color: #94A3B8;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 500;
  margin-left: 1.5rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: color 0.15s;
}

.dairy-nav .nav-links a:hover,
.dairy-nav .nav-links a.active {
  color: #fff;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
}

/* Mobile */
@media (max-width: 768px) {

  .dairy-nav {
    position: relative;
    padding: 0 1rem;
  }

  .menu-toggle {
    display: block;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 56px;
    left: 0;
    width: 100%;
    background: var(--ink);
    flex-direction: column;
    padding: 1rem 0;
    z-index: 999;
  }

  .nav-links.show {
    display: flex;
  }

  .nav-links a {
    margin: 0 !important;
    padding: 12px 20px;
    width: 100%;
    display: block;
  }
}

/* =============================================
   LAYOUT
   ============================================= */
.page-wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
}

.page-header {
  margin-bottom: 2rem;
}

.page-header h1 {
  font-family: 'Inter', sans-serif;
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--ink);
  margin: 0;
}

.page-header p {
  font-size: 0.85rem;
  color: var(--slate);
  margin: 0;
}


/* =============================================
   SECTION LABEL
   ============================================= */
.section-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--slate);
  margin-bottom: 0.75rem;
}


/* =============================================
   SUMMARY / STAT CARDS  (Dashboard)
   ============================================= */
.summary-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 2.5rem;
}

@media (min-width: 640px) {
  .summary-cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

.stat-card {
  background: var(--milk-white);
  border-radius: 12px;
  padding: 1.5rem 1.75rem;
  box-shadow: var(--card-shadow);
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--accent);
  border-radius: 12px 0 0 12px;
}

.stat-card.revenue::before {
  background: var(--success);
}

.stat-card .label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--slate);
  margin-bottom: 0.5rem;
}

.stat-card .value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.1;
}

.stat-card .sub {
  font-size: 0.78rem;
  color: var(--slate);
  margin-top: 0.3rem;
}


/* =============================================
   GENERIC DAIRY CARD
   ============================================= */
.dairy-card {
  background: var(--milk-white);
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: var(--card-shadow);
  overflow: hidden;
  margin-bottom: 1.75rem;
}

.dairy-card .card-head,
.card-head {
  padding: 1rem 1.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.dairy-card .card-head h2,
.card-head h2 {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0;
  color: var(--ink);
}

.card-body-pad {
  padding: 1.25rem 1.5rem;
}


/* =============================================
   TABLE CARD
   ============================================= */
.table-card {
  background: var(--milk-white);
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: var(--card-shadow);
  overflow: hidden;
  margin-bottom: 2.5rem;
}

.table-card .card-head {
  padding: 1rem 1.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.table-card .card-head h2 {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0;
  color: var(--ink);
}

.table-card .card-head .badge-date {
  font-size: 0.72rem;
  background: var(--accent-light);
  color: var(--accent);
  border-radius: 20px;
  padding: 0.25rem 0.75rem;
  font-weight: 600;
}

.table-card table {
  margin: 0;
}

.table-card thead th {
  font-size: 0.72rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--slate);
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  padding: 0.65rem 1.25rem;
  background: #FAFAFA;
}

.table-card tbody td {
  font-size: 0.875rem;
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid #F1F5F9;
  color: var(--ink);
  vertical-align: middle;
}

.table-card tbody tr:last-child td {
  border-bottom: none;
}

.table-card tbody tr:hover td {
  background: #F8FAFC;
}


/* =============================================
   PRODUCT PILLS
   ============================================= */
.product-pill {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.65rem;
  border-radius: 20px;
}

.pill-milk {
  background: #DBEAFE;
  color: #1D4ED8;
}

.pill-ghee {
  background: #FEF9C3;
  color: #854D0E;
}


/* =============================================
   BADGES
   ============================================= */
.badge-date {
  font-size: 0.72rem;
  background: var(--accent-light);
  color: var(--accent);
  border-radius: 20px;
  padding: 0.25rem 0.75rem;
  font-weight: 600;
}

.badge-count {
  font-size: 0.72rem;
  background: var(--accent-light);
  color: var(--accent);
  border-radius: 20px;
  padding: 0.25rem 0.75rem;
  font-weight: 600;
}

.badge-month {
  font-size: 0.72rem;
  background: var(--accent-light);
  color: var(--accent);
  border-radius: 20px;
  padding: 0.25rem 0.75rem;
  font-weight: 600;
}


/* =============================================
   AMOUNT VALUES
   ============================================= */
.amount-val {
  font-weight: 600;
  color: var(--success);
}


/* =============================================
   SEARCH SECTION
   ============================================= */
.search-card {
  background: var(--milk-white);
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: var(--card-shadow);
  overflow: hidden;
}

.search-card .card-head {
  padding: 1rem 1.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
}

.search-card .card-head h2 {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0;
  color: var(--ink);
}

.search-body {
  padding: 1.25rem 1.5rem;
}

.search-row {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.search-row input {
  flex: 1;
  min-width: 160px;
  font-size: 0.875rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.55rem 1rem;
  color: var(--ink);
  background: #FAFAFA;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.search-row input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
  background: #fff;
}

.search-row input::placeholder {
  color: #A0AEC0;
}

.btn-search {
  background: var(--ink);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.55rem 1.4rem;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}

.btn-search:hover {
  background: #2D3748;
}


/* =============================================
   CUSTOMER RESULT  (Dashboard search)
   ============================================= */
.customer-result {
  margin-top: 1.25rem;
  border-top: 1px solid var(--border);
  padding-top: 1.25rem;
  display: none;
}

.customer-result.visible {
  display: block;
}

.result-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 0.25rem;
}

.result-mobile {
  font-size: 0.8rem;
  color: var(--slate);
  margin-bottom: 1rem;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

@media (max-width: 500px) {
  .result-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 480px) {
  .result-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.result-stat {
  background: #F8FAFC;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem 1rem;
}

.result-stat .r-label {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--slate);
  margin-bottom: 0.25rem;
}

.result-stat .r-val {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
}

.result-stat.total .r-val {
  color: var(--success);
}


/* =============================================
   CUSTOMER RESULT  (Deliveries page variant)
   ============================================= */
.cust-result {
  margin-top: 1.25rem;
  border-top: 1px solid var(--border);
  padding-top: 1.25rem;
  display: none;
}

.cust-result.visible {
  display: block;
}

.cust-name {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.2rem;
}

.cust-mobile {
  font-size: 0.8rem;
  color: var(--slate);
  margin-bottom: 1rem;
}


/* =============================================
   EMPTY STATES
   ============================================= */
.empty-state {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--slate);
  font-size: 0.85rem;
  display: none;
}

.empty-state.visible {
  display: block;
}

.empty-state .icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  opacity: 0.4;
}

.empty-note {
  text-align: center;
  padding: 2rem;
  font-size: 0.85rem;
  color: var(--slate);
  display: none;
}

.empty-note.visible {
  display: block;
}

.empty-row td {
  text-align: center;
  color: var(--slate);
  font-size: 0.85rem;
  padding: 2.5rem !important;
}

.empty-bill {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--slate);
}

.empty-bill .icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
  opacity: 0.35;
}

.empty-bill p {
  font-size: 0.875rem;
  margin: 0;
}


/* =============================================
   FORM ELEMENTS
   ============================================= */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 0.75rem;
  align-items: end;
}

@media (max-width: 600px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

.form-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1.2fr;
  gap: 0.75rem;
  align-items: end;
}

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

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

.field-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.field-group label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--slate);
}

.field-group input,
.field-group select {
  font-size: 0.875rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.55rem 0.9rem;
  color: var(--ink);
  background: #FAFAFA;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  width: 100%;
}

.field-group input:focus,
.field-group select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
  background: #fff;
}

.field-group input::placeholder {
  color: #A0AEC0;
}


/* =============================================
   BUTTONS
   ============================================= */
.btn-primary-custom {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.575rem 1.4rem;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}

.btn-primary-custom:hover {
  background: #1D4ED8;
}

.btn-save {
  margin-top: 1rem;
  background: var(--success);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.6rem 1.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-save:hover {
  background: #047857;
}

.btn-generate {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.575rem 1.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}

.btn-generate:hover {
  background: #1D4ED8;
}

.btn-del {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.25rem 0.65rem;
  font-size: 0.75rem;
  color: var(--danger);
  cursor: pointer;
  transition: all 0.15s;
}

.btn-del:hover {
  background: #FEF2F2;
  border-color: var(--danger);
}

.btn-print {
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.45rem 1.1rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--slate);
  cursor: pointer;
  transition: all 0.15s;
}

.btn-print:hover {
  border-color: var(--ink);
  color: var(--ink);
}


/* =============================================
   AMOUNT DISPLAY  (Deliveries form)
   ============================================= */
.amount-display {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  background: var(--accent-light);
  border-radius: 8px;
  border: 1px solid #BFDBFE;
}

.amount-display .label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
}

.amount-display .value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--ink);
}


/* =============================================
   TOTALS STRIP  (Deliveries page)
   ============================================= */
.totals-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.75rem;
}

@media (max-width: 500px) {
  .totals-strip {
    grid-template-columns: 1fr;
  }
}

.total-tile {
  background: var(--milk-white);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1.25rem;
  box-shadow: var(--card-shadow);
}

.total-tile .t-label {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--slate);
  margin-bottom: 0.3rem;
}

.total-tile .t-val {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--ink);
}

.total-tile.revenue .t-val {
  color: var(--success);
}


/* =============================================
   BILL SUMMARY TILES  (Bills page)
   ============================================= */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 480px) {
  .summary-grid {
    grid-template-columns: 1fr;
  }
}

.summary-tile {
  border-radius: 10px;
  border: 1px solid var(--border);
  padding: 1.1rem 1.25rem;
}

.summary-tile .t-label {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--slate);
  margin-bottom: 0.3rem;
}

.summary-tile .t-val {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--ink);
}

.summary-tile .t-sub {
  font-size: 0.78rem;
  color: var(--slate);
  margin-top: 0.15rem;
}

.tile-milk {
  background: #EFF6FF;
  border-color: #BFDBFE;
}

.tile-ghee {
  background: #FFFBEB;
  border-color: #FDE68A;
}

.tile-milk .t-val {
  color: #1D4ED8;
}

.tile-ghee .t-val {
  color: var(--warning);
}


/* =============================================
   GRAND TOTAL BAR  (Bills page)
   ============================================= */
.grand-total-bar {
  background: var(--ink);
  border-radius: 10px;
  padding: 1.1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.grand-total-bar .gt-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #94A3B8;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.grand-total-bar .gt-val {
  font-size: 1.6rem;
  font-weight: 700;
  color: #fff;
  font-family: 'DM Serif Display', serif;
}


/* =============================================
   FLASH MESSAGES  (Customers page)
   ============================================= */
.flash {
  padding: 0.65rem 1rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 1.25rem;
}

.flash-success {
  background: #D1FAE5;
  color: #065F46;
  border: 1px solid #A7F3D0;
}

.flash-error {
  background: #FEE2E2;
  color: #991B1B;
  border: 1px solid #FECACA;
}


/* =============================================
   PRINT STYLES  (Bills page)
   ============================================= */
@media print {
  .dairy-nav,
  .generate-section,
  .section-label,
  .btn-print {
    display: none !important;
  }

  .page-wrap {
    padding: 0;
  }

  .dairy-card,
  .table-card {
    box-shadow: none;
    border: 1px solid #ddd;
  }
}

.custom-modal{
    display:none;
    position:fixed;
    inset:0;
    background:rgba(0,0,0,.55);
    justify-content:center;
    align-items:center;
    z-index:9999;
}

.modal-box{
    width:420px;
    max-width:90%;
    background:#fff;
    border-radius:20px;
    padding:24px;
    box-shadow:0 20px 50px rgba(0,0,0,.15);
}

.modal-box h3{
    margin-bottom:12px;
}

.modal-box p{
    color:#666;
    margin-bottom:20px;
}

.modal-actions{
    display:flex;
    justify-content:flex-end;
    gap:12px;
}

.btn-cancel{
    border:none;
    padding:10px 18px;
    border-radius:10px;
    cursor:pointer;
}

.btn-delete{
    background:#ef4444;
    color:white;
    border:none;
    padding:10px 18px;
    border-radius:10px;
    cursor:pointer;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.55);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.modal-overlay.show {
    display: flex;
}

.modal-box {
    background: white;
    width: 400px;
    max-width: 90%;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 20px 40px rgba(0,0,0,.2);
}

.modal-box h3 {
    margin-bottom: 10px;
}

.modal-box p {
    color: #64748b;
    margin-bottom: 20px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.btn-cancel {
    padding: 10px 18px;
    border: 1px solid #cbd5e1;
    background: white;
    border-radius: 8px;
    cursor: pointer;
}

.btn-confirm {
    padding: 10px 18px;
    border: none;
    background: #dc2626;
    color: white;
    border-radius: 8px;
    cursor: pointer;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #f5f4f0;
    min-height: 100vh;
}

/* ── Page layout ── */
.daily-page {
    max-width: 900px;
    margin: 48px auto;
    padding: 0 24px;
}

.page-title {
    font-size: 44px;
    font-weight: 700;
    color: #18213d;
    line-height: 1.1;
}

.page-subtitle {
    color: #667085;
    font-size: 15px;
    margin-top: 6px;
    margin-bottom: 32px;
}

.section-eyebrow {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: #667085;
    margin-bottom: 14px;
}

/* ── Main card ── */
.delivery-card {
    background: #fff;
    border-radius: 16px;
    border: 1px solid #e5e7eb;
    overflow: hidden;
}

.card-header {
    padding: 20px 28px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 18px;
    font-weight: 600;
    color: #18213d;
}

.card-body {
    padding: 28px;
}

/* ── Date badge ── */
.today-date {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #eef4ff;
    border: 1px solid #cfe1ff;
    color: #2459d3;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 24px;
}

/* ── Form fields ── */
.form-field {
    margin-bottom: 24px;
}

.form-field label,
.product-card label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #667085;
    margin-bottom: 8px;
}

.select-wrap {
    position: relative;
}

.select-wrap::after {
    content: '';
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid #94a3b8;
    pointer-events: none;
}

.form-control {
    width: 100%;
    height: 46px;
    padding: 0 14px;
    border: 1px solid #d8dce5;
    border-radius: 10px;
    font-size: 15px;
    color: #18213d;
    background: #fff;
    appearance: none;
    -webkit-appearance: none;
    outline: none;
    transition: border-color 0.18s, box-shadow 0.18s;
}

.form-control:focus {
    border-color: #4f7cff;
    box-shadow: 0 0 0 3px rgba(79, 124, 255, 0.12);
}

.form-control.error {
    border-color: #dc2626;
}

.field-error {
    font-size: 12px;
    color: #dc2626;
    margin-top: 4px;
    display: none;
}

/* ── Product section ── */
.product-section-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: #667085;
    margin-bottom: 14px;
}

.product-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* ── Product cards ── */
.product-card {
    border: 1px solid #e7e9ef;
    border-radius: 14px;
    padding: 24px;
    background: #fafafa;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.product-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.product-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.product-icon.milk { background: #e8f4fd; }
.product-icon.ghee { background: #fef7e6; }

.product-card h2 {
    font-size: 17px;
    font-weight: 700;
    color: #18213d;
}

.product-card-sub {
    font-size: 12px;
    color: #94a3b8;
    margin-top: 1px;
}

.product-card .form-control {
    background: #fff;
}

/* ── Save button ── */
.save-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 46px;
    background: #0f9d58;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    margin-top: 4px;
}

.save-btn:hover { background: #0b8a4c; }
.save-btn:active { transform: scale(0.98); }

/* ── Responsive ── */
@media (max-width: 600px) {
    .daily-page { margin: 24px auto; }
    .page-title { font-size: 30px; }
    .card-body { padding: 18px; }
    .product-wrapper { grid-template-columns: 1fr; }
}

.bill-actions{
    display:flex;
    gap:12px;
    margin-top:20px;
}

.btn-download,
.btn-whatsapp{
    text-decoration:none;
    padding:12px 22px;
    border-radius:10px;
    color:#fff;
    font-weight:600;
    transition:.3s;
}

.btn-download{
    background:#2563eb;
}

.btn-download:hover{
    background:#1d4ed8;
}

.btn-whatsapp{
    background:#25D366;
}

.btn-whatsapp:hover{
    background:#1fa855;
}

/* ===========================
   UPDATE RATE MODAL
=========================== */

.custom-modal{
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);

    display: none;

    justify-content: center;
    align-items: center;

    z-index: 9999;

    padding:20px;
}

.modal-box{

    width:100%;
    max-width:420px;

    background:#fff;

    border-radius:18px;

    padding:25px;

    box-shadow:0 20px 50px rgba(0,0,0,.18);

    animation:popup .25s ease;
}

.modal-box h3{

    margin-bottom:12px;

    font-size:24px;

    font-weight:700;

}

.modal-box p{

    margin-bottom:20px;

    color:#666;

}

.modal-box input{

    width:100%;

    padding:12px 15px;

    border:1px solid #ddd;

    border-radius:10px;

    font-size:16px;

    margin-top:8px;

}

.modal-actions{

    display:flex;

    justify-content:flex-end;

    gap:12px;

    margin-top:25px;

}

.btn-edit{
    background:#2563eb;
    color:#fff;

    border:1px solid #2563eb;

    padding:6px 12px;

    border-radius:6px;

    font-size:14px;

    cursor:pointer;

    transition:.25s;

    display:inline-flex;
    align-items:center;
    justify-content:center;
}

.btn-edit:hover{
    background:#1d4ed8;
    border-color:#1d4ed8;
}

.btn-cancel{

    background:#eee;

    border:none;

    padding:10px 18px;

    border-radius:10px;

    cursor:pointer;

}

@keyframes popup{

    from{

        transform:scale(.9);

        opacity:0;

    }

    to{

        transform:scale(1);

        opacity:1;

    }

}

/* ===========================
   MOBILE
=========================== */

@media (max-width:768px){

    .modal-box{

        max-width:100%;

        padding:20px;

        border-radius:14px;

    }

    .modal-actions{

        flex-direction:column;

    }

    .btn-edit,
    .btn-cancel{

        width:100%;

    }

}