/* =========================================================
   CUSTOMER PORTAL - Design System (v1)

   A dedicated look for the customer-facing portal, separate
   from the staff dashboard's teal SaaS theme (style.css).

   Concept: a broadband bill is a trust + money product used
   mostly on a phone, standing in the same mental aisle as
   bKash/Nagad. Deep ink-navy for trust and legibility, one
   confident amber for money/action (paying, balances, "pay
   now"), a separate blue for connectivity/data so it never
   competes with the money color. Mobile-first: a bottom tab
   bar carries primary navigation, the way local payment apps
   already teach people to navigate - not a hamburger hidden
   behind an icon.
   ========================================================= */

:root {
  /* -- Ink / neutrals -- */
  --ink:        #14213D;
  --ink-soft:   #5B6478;
  --ink-faint:  #939CB0;
  --line:       #E7EAF3;
  --bg:         #F2F4FA;
  --surface:    #FFFFFF;

  /* -- Brand -- */
  --navy:       #14213D;
  --navy-2:     #1E2E52;
  --navy-3:     #0B1226;

  /* -- Accent (money / primary action) -- */
  --gold:       #F2A93B;
  --gold-dark:  #D98A16;
  --gold-ink:   #46320A;

  /* -- Data / connectivity accent -- */
  --sky:        #2F6FED;
  --sky-soft:   #EAF0FE;

  /* -- Status -- */
  --success:      #17A672;
  --success-soft: #E4F7EE;
  --danger:       #E24B5A;
  --danger-soft:  #FDEBEC;
  --warn:         #E8871E;
  --warn-soft:    #FDF1E1;
  --muted-soft:   #EEF0F5;

  --radius-lg: 20px;
  --radius:    14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(20,33,61,.06), 0 1px 1px rgba(20,33,61,.04);
  --shadow-md: 0 8px 24px rgba(20,33,61,.09), 0 2px 6px rgba(20,33,61,.05);
  --shadow-lg: 0 20px 48px rgba(11,18,38,.22);
  --ease: cubic-bezier(.4,0,.2,1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', 'Noto Sans Bengali', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14.5px;
  -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; }

h1, h2, h3, h4, h5, h6, .display-num {
  font-family: 'Lexend', 'Noto Sans Bengali', -apple-system, sans-serif;
  letter-spacing: -.01em;
}

* { scrollbar-width: thin; scrollbar-color: #c7cddb transparent; }
*::-webkit-scrollbar { width: 7px; height: 7px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: #c7cddb; border-radius: 999px; }

/* ---------- Shell ---------- */
.pshell { min-height: 100vh; display: flex; }

/* Desktop sidebar */
.psidebar {
  width: 248px;
  flex-shrink: 0;
  background: linear-gradient(180deg, var(--navy-3), var(--navy) 55%, var(--navy-3));
  color: #c6ccdc;
  position: fixed;
  top: 0; bottom: 0; left: 0;
  overflow-y: auto;
  z-index: 1030;
  display: none;
}
.psidebar .brand {
  display: flex; align-items: center; gap: .7rem;
  padding: 1.35rem 1.25rem 1.1rem;
  color: #fff; font-weight: 700; font-size: 1.02rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.psidebar .logo-dot, .avatar-circle.logo-dot {
  width: 36px; height: 36px; border-radius: 11px;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; color: var(--gold-ink);
  box-shadow: 0 4px 10px rgba(217,138,22,.35);
  font-family: 'Lexend', sans-serif;
}
.psidebar .who {
  text-align: center; padding: 1.1rem .9rem 1.2rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.psidebar .who .avatar-circle { width: 54px; height: 54px; font-size: 1.25rem; margin: 0 auto .6rem; }
.psidebar .who .name { color: #fff; font-weight: 700; font-size: .95rem; }
.psidebar .who .meta { font-size: .74rem; color: #93a0bd; margin-top: 2px; }
.psidebar nav { padding: .6rem; }
.psidebar .nav-link {
  color: #b7c0d6; padding: .62rem .9rem; margin: .12rem 0;
  display: flex; align-items: center; justify-content: space-between; gap: .6rem;
  font-size: .87rem; font-weight: 500; border-radius: 10px;
  transition: background .15s var(--ease), color .15s var(--ease);
}
.psidebar .nav-link > span { display:flex; align-items:center; gap:.65rem; }
.psidebar .nav-link i { font-size: 1.05rem; width: 20px; text-align: center; }
.psidebar .nav-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.psidebar .nav-link.active { background: linear-gradient(135deg, rgba(242,169,59,.22), rgba(242,169,59,.06)); color: #fff; font-weight: 600; box-shadow: inset 2px 0 0 0 var(--gold); }
.psidebar .nav-link.active i { color: var(--gold); }
.psidebar .nav-link .badge { background: var(--danger); font-size: .64rem; }

.pmain { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* Top bar (all sizes) */
.ptopbar {
  background: var(--navy);
  color: #fff;
  padding: .85rem 1.1rem;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 1020;
  box-shadow: 0 2px 10px rgba(11,18,38,.18);
}
.ptopbar .brand-mini { display: flex; align-items: center; gap: .6rem; font-weight: 700; font-size: .98rem; }
.ptopbar .brand-mini img { height: 26px; width: 26px; border-radius: 7px; object-fit: contain; background: #fff; }
.ptopbar .page-title { font-weight: 700; font-size: 1.02rem; letter-spacing: -.01em; }
.ptopbar .page-subtitle { color: #aab4cc; font-size: .74rem; }
.avatar-circle {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: var(--gold-ink);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .85rem; flex-shrink: 0;
}
.ptopbar .avatar-btn { border: none; background: rgba(255,255,255,.08); border-radius: 999px; padding: 3px; display: flex; align-items:center; gap:.5rem; color:#fff; }
.ptopbar .avatar-btn:hover { background: rgba(255,255,255,.14); }

.pcontent { padding: 1.15rem 1.1rem 5.5rem; flex: 1; animation: fadeUp .3s var(--ease); max-width: 980px; width: 100%; margin: 0 auto; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

/* Bottom tab bar - mobile primary nav */
.pbottomnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 1040;
  background: var(--surface);
  border-top: 1px solid var(--line);
  display: flex;
  padding: .35rem .2rem calc(.35rem + env(safe-area-inset-bottom));
  box-shadow: 0 -6px 20px rgba(20,33,61,.08);
}
.pbottomnav a {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: .3rem 0; color: var(--ink-faint); font-size: .66rem; font-weight: 600;
  position: relative;
}
.pbottomnav a i { font-size: 1.22rem; }
.pbottomnav a.active { color: var(--gold-dark); }
.pbottomnav a .nb-badge {
  position: absolute; top: -1px; right: 26%;
  background: var(--danger); color: #fff; font-size: .58rem; font-weight: 700;
  min-width: 15px; height: 15px; border-radius: 999px; display: flex; align-items: center; justify-content: center;
}

@media (min-width: 992px) {
  .psidebar { display: block; }
  .pmain { margin-left: 248px; }
  .pcontent { padding: 1.6rem 2rem 2rem; max-width: 1080px; }
  .pbottomnav { display: none; }
  .ptopbar .brand-mini { display: none; }
}
@media (max-width: 991px) {
  .ptopbar .desktop-only { display: none; }
}

/* Larger tap targets on touch */
@media (hover: none) and (pointer: coarse) {
  .btn { min-height: 42px; }
  .form-select, .form-control { min-height: 42px; }
}

/* ---------- Hero (dashboard connection/status card) ---------- */
.hero-card {
  border-radius: var(--radius-lg);
  background:
    radial-gradient(520px 200px at 100% 0%, rgba(242,169,59,.18), transparent 60%),
    linear-gradient(160deg, var(--navy-2), var(--navy-3));
  color: #fff;
  padding: 1.4rem 1.5rem;
  box-shadow: var(--shadow-lg);
  margin-bottom: 1rem;
  position: relative;
  overflow: hidden;
}
.hero-card .hero-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; }
.hero-card .hero-label { font-size: .74rem; color: #9AA6C4; font-weight: 600; }
.hero-card .hero-pkg { font-family: 'Lexend', sans-serif; font-weight: 700; font-size: 1.25rem; margin-top: 2px; }
.hero-card .hero-pill {
  display: inline-flex; align-items: center; gap: .4rem;
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.14);
  padding: .32em .8em; border-radius: 999px; font-size: .76rem; font-weight: 600;
}
.hero-card .hero-pill.on  { background: rgba(23,166,114,.22); border-color: rgba(23,166,114,.4); color: #7CE8BE; }
.hero-card .hero-pill.off { background: rgba(255,255,255,.08); color: #C6CDE0; }
.hero-card .hero-pill.warn{ background: rgba(226,75,90,.2); border-color: rgba(226,75,90,.4); color: #FFB0B8; }
.hero-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: .9rem; margin-top: 1.3rem; }
.hero-grid .hg-label { font-size: .68rem; color: #93A0BD; text-transform: uppercase; letter-spacing: .04em; }
.hero-grid .hg-value { font-family: 'Lexend', sans-serif; font-weight: 700; font-size: 1.05rem; margin-top: 2px; }
@media (max-width: 480px) { .hero-grid { grid-template-columns: repeat(3,1fr); gap: .6rem; } .hero-grid .hg-value { font-size: .92rem; } }

/* ---------- Cards ---------- */
.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  background: var(--surface);
}
.card-header {
  background: transparent;
  border-bottom: 1px solid var(--line);
  font-weight: 700;
  font-family: 'Lexend', sans-serif;
  font-size: .9rem;
  padding: .9rem 1.1rem;
  color: var(--ink);
}
.card-body { padding: 1.1rem; }
.card-footer { border-top: 1px solid var(--line); background: var(--surface); }

.stat-card {
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 1rem 1.1rem;
  display: flex; align-items: center; gap: .85rem;
  box-shadow: var(--shadow-sm);
  height: 100%;
}
.stat-card .icon-badge {
  width: 44px; height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.15rem; flex-shrink: 0;
}
.stat-card .stat-value { font-family: 'Lexend', sans-serif; font-size: 1.3rem; font-weight: 700; color: var(--ink); line-height: 1.2; }
.stat-card .stat-label { color: var(--ink-soft); font-size: .76rem; margin-top: 1px; }

.bg-soft-teal  { background: var(--success-soft); color: var(--success); }
.bg-soft-blue  { background: var(--sky-soft); color: var(--sky); }
.bg-soft-amber { background: var(--warn-soft); color: var(--warn); }
.bg-soft-gold  { background: rgba(242,169,59,.16); color: var(--gold-dark); }
.bg-soft-rose  { background: var(--danger-soft); color: var(--danger); }

/* ---------- Buttons ---------- */
.btn { border-radius: var(--radius-sm); font-weight: 600; font-size: .88rem; transition: all .15s var(--ease); }
.btn-accent {
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  border-color: var(--gold-dark);
  color: var(--gold-ink);
  box-shadow: 0 2px 10px rgba(217,138,22,.3);
}
.btn-accent:hover { filter: brightness(1.04); color: var(--gold-ink); box-shadow: 0 4px 16px rgba(217,138,22,.4); transform: translateY(-1px); }
.btn-accent:active { transform: translateY(0); }
.btn-outline-accent { border: 1.5px solid var(--gold-dark); color: var(--gold-dark); font-weight: 600; background: #fff; }
.btn-outline-accent:hover { background: var(--gold); color: var(--gold-ink); border-color: var(--gold); }
.btn-outline-secondary { border-color: var(--line); color: var(--ink-soft); }
.btn-outline-secondary:hover { background: var(--muted-soft); color: var(--ink); border-color: var(--line); }
.btn-link { color: var(--sky); }

/* ---------- Forms ---------- */
.form-label { font-weight: 600; font-size: .82rem; color: var(--ink); }
.form-control, .form-select {
  border-radius: var(--radius-sm);
  border-color: var(--line);
  font-size: .89rem;
  background: #fff;
}
.form-control:focus, .form-select:focus {
  border-color: var(--gold-dark);
  box-shadow: 0 0 0 3px rgba(242,169,59,.18);
}
.form-check-input:checked { background-color: var(--gold-dark); border-color: var(--gold-dark); }
.form-check-input:focus { box-shadow: 0 0 0 3px rgba(242,169,59,.18); }

/* ---------- Badges / status ---------- */
.badge-status { font-weight: 700; font-size: .68rem; padding: .38em .75em; border-radius: 999px; letter-spacing: .01em; }
.badge-pending   { background: var(--warn-soft); color: var(--warn); }
.badge-active    { background: var(--success-soft); color: var(--success); }
.badge-suspended { background: var(--danger-soft); color: var(--danger); }
.badge-inactive  { background: var(--muted-soft); color: var(--ink-soft); }
.badge-unpaid    { background: var(--danger-soft); color: var(--danger); }
.badge-partial   { background: var(--warn-soft); color: var(--warn); }
.badge-paid      { background: var(--success-soft); color: var(--success); }
.status-dot { display:inline-block; width:8px; height:8px; border-radius:50%; margin-right:5px; }
.status-dot.online  { background: var(--success); box-shadow: 0 0 0 3px rgba(23,166,114,.15); }
.status-dot.offline { background: #b3bacb; }
.status-dot.unknown { background: var(--warn); }

/* ---------- Tables -> stacked list on mobile ---------- */
.table thead th {
  font-size: .68rem; text-transform: uppercase; letter-spacing: .05em;
  color: var(--ink-soft); background: #FAFBFE; border-bottom-width: 1px; font-weight: 700;
}
.table td { vertical-align: middle; font-size: .87rem; }
.table-hover tbody tr:hover { background: #FAFBFE; }

@media (max-width: 640px) {
  table.ledger-table thead { display: none; }
  table.ledger-table, table.ledger-table tbody, table.ledger-table tr, table.ledger-table td { display: block; width: 100%; }
  table.ledger-table tr { padding: .8rem 1.1rem; border-bottom: 1px solid var(--line); }
  table.ledger-table tr:last-child { border-bottom: none; }
  table.ledger-table td { padding: .15rem 0; border: none; display: flex; justify-content: space-between; gap: .8rem; }
  table.ledger-table td::before { content: attr(data-label); color: var(--ink-faint); font-size: .72rem; font-weight: 600; }
  table.ledger-table td.ledger-remarks::before { content: none; }
  table.ledger-table td.ledger-remarks { justify-content: flex-start; margin-top: 2px; }
}

/* ---------- List groups ---------- */
.list-group-item { border-color: var(--line); padding: .85rem 1.1rem; }
.list-group-flush > .list-group-item:hover { background: #FAFBFE; }

/* ---------- Alerts ---------- */
.alert { border-radius: var(--radius-sm); border: 1px solid transparent; font-size: .87rem; }
.alert-warning { background: var(--warn-soft); color: #7A4A0E; }
.alert-danger  { background: var(--danger-soft); color: #94212D; }
.alert-success { background: var(--success-soft); color: #0E6B4C; }

/* ---------- Misc ---------- */
.text-muted-soft { color: var(--ink-soft); }
.divider-label { text-transform: uppercase; font-size: .68rem; letter-spacing: .06em; color: var(--ink-soft); font-weight: 700; }

/* ---------- Ticket chat bubbles ---------- */
.chat-msg { display: flex; margin-bottom: .9rem; }
.chat-msg.from-client { justify-content: flex-end; }
.chat-msg .bubble-wrap { max-width: 78%; }
.chat-msg .bubble-meta { font-size: .7rem; color: var(--ink-faint); margin-bottom: 3px; }
.chat-msg.from-client .bubble-meta { text-align: right; }
.chat-msg .bubble { padding: .6rem .9rem; border-radius: 14px; font-size: .88rem; line-height: 1.45; }
.chat-msg.from-client .bubble { background: linear-gradient(135deg, var(--gold), var(--gold-dark)); color: var(--gold-ink); border-bottom-right-radius: 4px; }
.chat-msg.from-staff .bubble { background: var(--muted-soft); color: var(--ink); border-bottom-left-radius: 4px; }

/* ---------- Empty states ---------- */
.empty-state { text-align: center; padding: 2.4rem 1rem; color: var(--ink-soft); }
.empty-state i { font-size: 2.1rem; color: var(--ink-faint); display: block; margin-bottom: .5rem; }

/* ---------- Login ---------- */
.login-shell {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1.5rem;
  background:
    radial-gradient(650px 480px at 14% 10%, rgba(242,169,59,.14), transparent 60%),
    radial-gradient(900px 620px at 90% 90%, rgba(47,111,237,.18), transparent 60%),
    linear-gradient(160deg, var(--navy-3), var(--navy) 60%);
}
.login-card {
  width: 100%; max-width: 400px;
  background: rgba(255,255,255,.99);
  border-radius: var(--radius-lg);
  padding: 2.2rem 1.9rem;
  box-shadow: var(--shadow-lg);
}
.login-card .logo-dot {
  width: 54px; height: 54px; border-radius: 16px;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 1.3rem; color: var(--gold-ink);
  margin: 0 auto 1rem;
  box-shadow: 0 8px 20px rgba(217,138,22,.35);
  font-family: 'Lexend', sans-serif;
}

/* ---------- Dropdown ---------- */
.dropdown-menu { border-radius: var(--radius-sm); border: 1px solid var(--line); box-shadow: var(--shadow-md); padding: .4rem; }
.dropdown-item { border-radius: 7px; font-size: .86rem; padding: .5rem .7rem; }
.dropdown-item:hover { background: var(--bg); }