/* =============================================
   css/styles.css — Nandini Dairy
   Shared by: index.html, admin.html, subscriber.html
   ============================================= */

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

/* ── Root Variables ── */
:root {
  --bg:       #07080f;
  --card:     #0f111b;
  --border:   rgba(255,255,255,0.09);
  --text:     #eeeef4;
  --muted:    #5a5c70;
  --green:    #4ade80;
  --green-dk: #16a34a;
  --orange:   #f97316;
  --danger:   #ef4444;
  --purple:   #a855f7;
  --cyan:     #22d3ee;
  --font:     'Segoe UI', Tahoma, Arial, sans-serif;
}

/* ── Base ── */
html, body {
  background:  var(--bg);
  color:       var(--text);
  font-family: var(--font);
  min-height:  100vh;
}
input, button { font-family: var(--font); }
input[type=number]::-webkit-inner-spin-button { opacity: 1; }

/* ── Toast ── */
.toast {
  position:   fixed;
  bottom:     24px;
  left:       50%;
  transform:  translateX(-50%);
  z-index:    9999;
  padding:    12px 24px;
  border-radius: 12px;
  font-size:  14px;
  font-weight: 700;
  color:      #fff;
  white-space: nowrap;
  max-width:  92vw;
  text-align: center;
  opacity:    0;
  transition: opacity 0.3s;
  pointer-events: none;
}
.toast.show    { opacity: 1; pointer-events: auto; }
.toast.success { background: #16a34a; }
.toast.error   { background: var(--danger); }

/* ── Bill Modal ── */
.bill-modal {
  position:   fixed;
  inset:      0;
  z-index:    500;
  background: rgba(0,0,0,0.93);
  display:    none;
  align-items: center;
  justify-content: center;
  padding:    16px;
  overflow-y: auto;
}
.bill-modal.show { display: flex; }
.bill-wrap { width: 100%; max-width: 400px; }
.bill-card {
  background:    #fff;
  border-radius: 18px;
  overflow:      hidden;
  box-shadow:    0 24px 60px rgba(0,0,0,0.6);
}
.bill-actions {
  display:        flex;
  flex-direction: column;
  gap:            10px;
  margin-top:     12px;
}

/* ── Card ── */
.card {
  background:    var(--card);
  border:        1px solid var(--border);
  border-radius: 16px;
  padding:       20px;
  margin-bottom: 12px;
}
.card-inner {
  background:    rgba(255,255,255,0.03);
  border:        1px solid var(--border);
  border-radius: 12px;
  padding:       12px;
}
.card-empty {
  background:    var(--card);
  border:        1px solid var(--border);
  border-radius: 16px;
  padding:       48px 20px;
  text-align:    center;
  color:         var(--muted);
  margin-bottom: 12px;
}
.card-empty .icon  { font-size: 44px; margin-bottom: 12px; }
.card-empty .title { font-weight: 700; color: #fff; margin-bottom: 6px; font-size: 15px; }
.card-empty .sub   { font-size: 13px; line-height: 1.6; }

/* ── Input ── */
.inp {
  display:        block;
  width:          100%;
  padding:        13px 14px;
  background:     rgba(255,255,255,0.07);
  border:         1.5px solid var(--border);
  border-radius:  12px;
  color:          var(--text);
  font-size:      15px;
  outline:        none;
  margin-bottom:  14px;
  font-family:    var(--font);
}
.inp:focus       { border-color: var(--green); }
.inp::placeholder { color: var(--muted); }

/* ── Buttons ── */
.btn {
  display:       block;
  width:         100%;
  padding:       14px;
  border:        none;
  border-radius: 12px;
  font-size:     15px;
  font-weight:   700;
  cursor:        pointer;
  color:         #fff;
  margin-top:    4px;
  font-family:   var(--font);
}
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-green  { background: linear-gradient(135deg,#22c55e,#16a34a); }
.btn-orange { background: linear-gradient(135deg,#f97316,#ea580c); }
.btn-purple { background: linear-gradient(135deg,#5f259f,#7b2ff7); }
.btn-ghost  { background: rgba(255,255,255,0.06); color: #888; }
.btn-red    { background: rgba(239,68,68,0.12);   color: var(--danger); }
.btn-cyan   { background: rgba(34,211,238,0.1);   color: var(--cyan); }
.btn-wa     { background: linear-gradient(135deg,#25d366,#128c7e); }

/* Small buttons */
.sbtn {
  padding:       9px 16px;
  border:        none;
  border-radius: 10px;
  font-size:     13px;
  font-weight:   700;
  cursor:        pointer;
  display:       inline-block;
  font-family:   var(--font);
}
.sbtn-green  { background: linear-gradient(135deg,#22c55e,#16a34a); color: #fff; }
.sbtn-orange { background: linear-gradient(135deg,#f97316,#ea580c); color: #fff; }
.sbtn-red    { background: rgba(239,68,68,0.12);  color: var(--danger); }
.sbtn-cyan   { background: rgba(34,211,238,0.1);  color: var(--cyan); }
.sbtn-gray   { background: rgba(255,255,255,0.08); color: #ccc; }

/* ── Error text ── */
.err-txt {
  color:         var(--danger);
  font-size:     12px;
  margin-top:    -10px;
  margin-bottom: 10px;
  display:       none;
}
.err-txt.show { display: block; }

/* ── Label ── */
.lbl {
  font-size:   12px;
  color:       var(--muted);
  font-weight: 600;
  margin-bottom: 6px;
  display:     block;
}

/* ── Badge ── */
.badge {
  display:       inline-block;
  padding:       3px 10px;
  border-radius: 20px;
  font-size:     11px;
  font-weight:   700;
}

/* ── Header ── */
.header {
  background:     #0b0d18;
  border-bottom:  1px solid var(--border);
  padding:        14px 16px;
  display:        flex;
  align-items:    center;
  justify-content: space-between;
  position:       sticky;
  top:            0;
  z-index:        100;
}
.header-left { display: flex; align-items: center; gap: 10px; }
.header-title { font-weight: 800; font-size: 15px; color: #fff; }
.header-sub   { font-size: 11px; margin-top: 2px; }
.header-right { display: flex; align-items: center; gap: 12px; }

/* ── Bell ── */
.bell-wrap { position: relative; cursor: pointer; font-size: 24px; line-height: 1; }
.bell-dot {
  position:      absolute;
  top:           -5px;
  right:         -6px;
  background:    var(--danger);
  color:         #fff;
  border-radius: 50%;
  width:         18px;
  height:        18px;
  display:       none;
  align-items:   center;
  justify-content: center;
  font-size:     10px;
  font-weight:   800;
}
.bell-dot.show { display: flex; }
.sign-out-btn {
  background:    rgba(255,255,255,0.06);
  border:        none;
  border-radius: 10px;
  color:         #aaa;
  padding:       7px 14px;
  font-size:     12px;
  cursor:        pointer;
}

/* ── Tab Navigation ── */
.tab-nav {
  display:        flex;
  border-bottom:  1px solid var(--border);
  background:     var(--bg);
  position:       sticky;
  top:            57px;
  z-index:        99;
  overflow-x:     auto;
}
.tab-nav::-webkit-scrollbar { display: none; }
.tab-btn {
  flex:           1;
  min-width:      52px;
  padding:        13px 8px;
  border:         none;
  cursor:         pointer;
  background:     transparent;
  color:          var(--muted);
  font-size:      20px;
  border-bottom:  2px solid transparent;
  position:       relative;
}
.tab-btn.active {
  color:         #fff;
  border-bottom: 2px solid var(--orange);
  background:    rgba(255,255,255,0.05);
}
.tab-badge {
  position:      absolute;
  top:           6px;
  right:         4px;
  background:    var(--danger);
  color:         #fff;
  border-radius: 50%;
  width:         16px;
  height:        16px;
  display:       none;
  align-items:   center;
  justify-content: center;
  font-size:     9px;
  font-weight:   800;
}
.tab-badge.show { display: flex; }

/* ── Page body ── */
.page-body {
  padding:        16px;
  max-width:      860px;
  padding-bottom: 40px;
}
.sec-title {
  font-weight:   700;
  color:         #fff;
  font-size:     15px;
  margin-bottom: 14px;
}

/* ── Stats row ── */
.stats-row {
  display:               grid;
  grid-template-columns: repeat(3,1fr);
  gap:                   10px;
  margin-bottom:         16px;
}
.stat-box {
  background:    var(--card);
  border:        1px solid var(--border);
  border-radius: 14px;
  padding:       14px;
  text-align:    center;
}
.stat-num { font-size: 26px; font-weight: 800; line-height: 1; }
.stat-lbl { font-size: 11px; color: var(--muted); margin-top: 4px; }

/* ── Token bar ── */
.token-bar {
  background:    rgba(255,255,255,0.06);
  border-radius: 100px;
  height:        8px;
  overflow:      hidden;
  margin:        10px 0 6px;
}
.token-fill {
  height:        100%;
  border-radius: 100px;
  transition:    width 0.5s;
}

/* ── Checkbox product rows ── */
.check-row {
  display:       flex;
  align-items:   center;
  gap:           10px;
  padding:       12px;
  margin-bottom: 8px;
  background:    rgba(255,255,255,0.03);
  border:        1.5px solid var(--border);
  border-radius: 12px;
  cursor:        pointer;
  user-select:   none;
}
.check-box {
  width:         22px;
  height:        22px;
  border-radius: 6px;
  flex-shrink:   0;
  background:    rgba(255,255,255,0.08);
  border:        2px solid rgba(255,255,255,0.2);
  display:       flex;
  align-items:   center;
  justify-content: center;
  font-size:     13px;
  font-weight:   800;
  color:         #fff;
}
.qty-input {
  width:         60px;
  background:    rgba(255,255,255,0.1);
  border-radius: 8px;
  color:         #fff;
  padding:       8px;
  font-size:     18px;
  font-weight:   800;
  text-align:    center;
  outline:       none;
  border:        2px solid transparent;
  font-family:   var(--font);
}

/* ── Notification banner ── */
.notif-bar {
  background:    linear-gradient(90deg,#1a0a00,#2a1200,#1a0a00);
  border-bottom: 1px solid rgba(249,115,22,0.3);
  padding:       10px 0;
  overflow:      hidden;
  display:       none;
  position:      relative;
}
.notif-bar.show { display: block; }
.notif-bar.urgent { background: linear-gradient(90deg,#1a0000,#2a0000,#1a0000); }
.notif-bar.info   { background: linear-gradient(90deg,#001a10,#002a18,#001a10); }
.notif-inner {
  display:     flex;
  align-items: center;
  gap:         12px;
  white-space: nowrap;
  overflow:    hidden;
}
@keyframes marquee {
  0%   { transform: translateX(100vw); }
  100% { transform: translateX(-100%); }
}
.notif-text {
  font-size:   13px;
  font-weight: 600;
  color:       #fff;
  animation:   marquee 18s linear infinite;
  display:     inline-block;
  padding-right: 60px;
}
.notif-close {
  position:      absolute;
  right:         12px;
  top:           50%;
  transform:     translateY(-50%);
  background:    rgba(255,255,255,0.1);
  border:        none;
  color:         #fff;
  width:         24px;
  height:        24px;
  border-radius: 50%;
  cursor:        pointer;
}

/* ── Login page ── */
.login-bg {
  min-height:      100vh;
  background:      radial-gradient(ellipse at 50% 30%,#0a1f0a,#07080f 65%);
  display:         flex;
  align-items:     center;
  justify-content: center;
  padding:         20px;
}
.login-box { width: 100%; max-width: 360px; }
.logo      { text-align: center; margin-bottom: 32px; }
.logo-icon { font-size: 56px; display: block; margin-bottom: 8px; }
.logo-name { font-size: 26px; font-weight: 800; color: #fff; }
.logo-sub  { font-size: 13px; color: var(--muted); margin-top: 4px; }

/* Mode tabs */
.mode-tabs {
  display:       flex;
  background:    rgba(255,255,255,0.04);
  border-radius: 14px;
  padding:       4px;
  margin-bottom: 20px;
  border:        1px solid var(--border);
}
.mode-tab {
  flex:          1;
  padding:       11px;
  border:        none;
  border-radius: 11px;
  font-size:     14px;
  font-weight:   700;
  cursor:        pointer;
  background:    transparent;
  color:         var(--muted);
  font-family:   var(--font);
}
.mode-tab.active { background: var(--green); color: #000; }

/* Steps */
.steps { display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 6px; }
.step {
  width:         32px;
  height:        32px;
  border-radius: 50%;
  display:       flex;
  align-items:   center;
  justify-content: center;
  font-size:     13px;
  font-weight:   800;
  border:        2px solid var(--border);
  color:         var(--muted);
}
.step.active { background: var(--green); border-color: var(--green); color: #000; }
.step.done   { background: rgba(74,222,128,0.15); border-color: var(--green); color: var(--green); }
.step-line   { flex: 1; height: 2px; background: var(--border); border-radius: 2px; max-width: 60px; }
.step-line.done { background: var(--green); }
.step-label  { font-size: 12px; color: var(--muted); text-align: center; margin-bottom: 16px; font-weight: 600; }

/* Phone row */
.phone-row { display: flex; gap: 8px; margin-bottom: 14px; }
.flag-code {
  background:    rgba(255,255,255,0.07);
  border:        1.5px solid var(--border);
  border-radius: 12px;
  padding:       13px 12px;
  font-size:     15px;
  color:         var(--text);
  font-weight:   700;
  flex-shrink:   0;
  display:       flex;
  align-items:   center;
}

/* Step 2 summary */
.step2-box {
  background:    rgba(74,222,128,0.08);
  border:        1px solid rgba(74,222,128,0.2);
  border-radius: 12px;
  padding:       12px 14px;
  margin-bottom: 16px;
  display:       flex;
  align-items:   center;
  gap:           10px;
}

/* ── Subscriber page ── */
.sub-header-right { text-align: right; }
.sub-tok-count    { font-size: 22px; font-weight: 800; color: var(--green); line-height: 1; }
.sub-tok-label    { font-size: 10px; color: var(--muted); }

.bill-alert {
  background:    rgba(95,37,159,0.12);
  border:        2px solid rgba(95,37,159,0.4);
  border-radius: 16px;
  padding:       18px;
  margin-bottom: 14px;
}
.pend-alert {
  background:    rgba(249,115,22,0.08);
  border:        2px solid rgba(249,115,22,0.3);
  border-radius: 16px;
  padding:       18px;
  margin-bottom: 14px;
  text-align:    center;
}

/* ── Estimate box ── */
.estimate-box {
  background:    rgba(59,130,246,0.08);
  border:        1px solid rgba(59,130,246,0.25);
  border-radius: 12px;
  padding:       14px;
  margin:        12px 0;
}

/* ── Settings ── */
.edit-inp {
  display:       block;
  width:         100%;
  padding:       10px 12px;
  background:    rgba(255,255,255,0.07);
  border:        1.5px solid var(--border);
  border-radius: 10px;
  color:         var(--text);
  font-size:     14px;
  outline:       none;
  margin-bottom: 10px;
  font-family:   var(--font);
}
.edit-inp:focus { border-color: var(--green); }
.rate-input {
  width:         100%;
  background:    rgba(255,255,255,0.08);
  border:        2px solid var(--border);
  border-radius: 10px;
  color:         #fff;
  padding:       10px;
  font-size:     20px;
  font-weight:   800;
  text-align:    center;
  outline:       none;
  font-family:   var(--font);
}
.calc-box {
  background:    rgba(74,222,128,0.07);
  border:        1px solid rgba(74,222,128,0.2);
  border-radius: 10px;
  padding:       10px 14px;
  text-align:    center;
  min-width:     90px;
}
.img-prev {
  width:         64px;
  height:        64px;
  border-radius: 12px;
  background:    rgba(255,255,255,0.06);
  border:        2px dashed rgba(255,255,255,0.2);
  display:       flex;
  align-items:   center;
  justify-content: center;
  font-size:     28px;
  flex-shrink:   0;
  overflow:      hidden;
}
.img-prev img { width: 100%; height: 100%; object-fit: cover; border-radius: 10px; }
.emoji-row   { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.emoji-btn {
  background:    rgba(255,255,255,0.06);
  border:        1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  padding:       8px;
  font-size:     20px;
  cursor:        pointer;
}
.emoji-btn.active { border-color: var(--green); background: rgba(74,222,128,0.15); }
.color-row { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.color-dot {
  width:         26px;
  height:        26px;
  border-radius: 50%;
  border:        2px solid transparent;
  cursor:        pointer;
}
.color-dot.active { border: 3px solid #fff; transform: scale(1.1); }

/* Notif type grid */
.notif-type-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.notif-type-btn {
  padding:       10px;
  border-radius: 10px;
  font-size:     13px;
  font-weight:   600;
  cursor:        pointer;
  text-align:    center;
  background:    rgba(255,255,255,0.03);
  border:        1.5px solid var(--border);
  color:         var(--muted);
  font-family:   var(--font);
}
.notif-type-btn.active {
  border-color: var(--orange);
  background:   rgba(249,115,22,0.1);
  color:        var(--orange);
}

/* ── Scrollbar ── */
::-webkit-scrollbar        { width: 4px; height: 4px; }
::-webkit-scrollbar-thumb  { background: rgba(255,255,255,0.1); border-radius: 2px; }

/* ── Responsive ── */
@media (max-width: 480px) {
  .page-body { padding: 12px; }
  .stats-row { gap: 8px; }
}
