/* KMC Library — ওয়েব পোর্টাল। রং অ্যাপের মতো (লোগো থেকে: টিল, জলপাই, সোনালি)। */
:root {
  --primary: #0E5A73; --on-primary: #fff; --primary-c: #CDEBF2; --on-primary-c: #052E3B;
  --tertiary: #4D7C3A; --gold: #B8860B;
  --bg: #F7F5EF; --surface: #fff; --on: #1A1C1C; --muted: #44514F; --variant: #E6ECEC; --outline: #C9D2D1;
  --good: #1B7F3B; --warn: #B45309; --bad: #B3261E; --info: #0E5A73;
  --bar: #0E5A73; --on-bar: #fff;
  --radius: 16px; --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --primary: #7CCDE3; --on-primary: #003544; --primary-c: #0C4A5E; --on-primary-c: #CDEBF2;
  --tertiary: #A7D38F; --gold: #F1C75B;
  --bg: #0D1517; --surface: #131D20; --on: #E2E9EB; --muted: #BCC8CC; --variant: #24323A; --outline: #33444B;
  --good: #7DD99A; --warn: #F5B94E; --bad: #FF8A80; --info: #7CCDE3;
  --bar: #0C3D4D; --on-bar: #E2E9EB;
  --shadow: none; color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--on); }
body { font: 16px/1.5 "Noto Sans Bengali", "Hind Siliguri", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--primary); }
img { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }

.shell { max-width: 720px; margin: 0 auto; min-height: 100vh; padding-bottom: 84px; }
.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; background: var(--bar); color: var(--on-bar); }
.topbar h1 { flex: 1; margin: 0; font-size: 18px; font-weight: 700; display: flex; align-items: center; gap: 10px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar h1 img { width: 32px; height: 32px; border-radius: 50%; background: #fff; }
.topbar button { background: transparent; border: 0; color: inherit; padding: 8px; border-radius: 10px; cursor: pointer; font-size: 15px; }
.topbar button:hover { background: rgba(255,255,255,.12); }
main { padding: 16px; }

.bottomnav { position: fixed; bottom: 0; left: 0; right: 0; z-index: 10; background: var(--surface);
  border-top: 1px solid var(--outline); display: flex; justify-content: center; }
.bottomnav .in { display: flex; width: 100%; max-width: 720px; }
.bottomnav a { flex: 1; text-align: center; padding: 8px 4px 10px; text-decoration: none; color: var(--muted); font-size: 12px; }
.bottomnav a span { display: block; font-size: 22px; line-height: 1.2; }
.bottomnav a.on { color: var(--primary); font-weight: 700; }

.card { background: var(--surface); border-radius: var(--radius); padding: 16px; margin: 0 0 12px; box-shadow: var(--shadow);
  border: 1px solid var(--outline); }
.card h2, h2.section { font-size: 17px; margin: 0 0 10px; }
h2.section { margin: 22px 0 10px; display: flex; align-items: center; }
h2.section .grow { flex: 1; }
h2.section a { font-size: 14px; font-weight: 600; text-decoration: none; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.row { display: flex; align-items: center; gap: 12px; }
.row .grow { flex: 1; min-width: 0; }
.kv { display: flex; justify-content: space-between; gap: 16px; padding: 4px 0; }
.kv b { font-weight: 600; text-align: right; }

.btn { display: block; width: 100%; padding: 12px 16px; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--primary); color: var(--on-primary); font-weight: 600; text-align: center; text-decoration: none; margin: 8px 0; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.outline { background: transparent; color: var(--primary); border: 1.5px solid var(--primary); }
.btn.text { background: transparent; color: var(--primary); width: auto; display: inline-block; padding: 8px 6px; }
.btn.danger { color: var(--bad); }
.linkrow { display: flex; justify-content: space-between; flex-wrap: wrap; }

label.f { display: block; margin: 10px 0; }
label.f > span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
input[type=text], input[type=url], input[type=email], input[type=password], input[type=tel], input[type=date], input[type=number], input[type=search], select, textarea {
  width: 100%; padding: 12px; border-radius: 12px; border: 1.5px solid var(--outline); background: var(--surface); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); }
textarea { min-height: 80px; }
.check { display: flex; gap: 10px; align-items: flex-start; margin: 12px 0; }
.check input { margin-top: 4px; width: 18px; height: 18px; }
.help { font-size: 12px; color: var(--muted); margin-top: 4px; }

.msg { padding: 12px 14px; border-radius: 12px; margin: 8px 0; white-space: pre-line; }
.msg.good { background: color-mix(in srgb, var(--good) 12%, transparent); color: var(--good); }
.msg.warn { background: color-mix(in srgb, var(--warn) 12%, transparent); color: var(--warn); }
.msg.bad { background: color-mix(in srgb, var(--bad) 12%, transparent); color: var(--bad); }
.msg.info { background: color-mix(in srgb, var(--info) 12%, transparent); color: var(--info); }
.msg .btn { margin-top: 10px; }
.chip { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.chip.good { background: color-mix(in srgb, var(--good) 14%, transparent); color: var(--good); }
.chip.warn { background: color-mix(in srgb, var(--warn) 14%, transparent); color: var(--warn); }
.chip.bad { background: color-mix(in srgb, var(--bad) 14%, transparent); color: var(--bad); }
.chip.info { background: color-mix(in srgb, var(--info) 14%, transparent); color: var(--info); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 8px; }
.chips button { flex: none; border: 1.5px solid var(--outline); background: var(--surface); border-radius: 10px; padding: 6px 12px; cursor: pointer; }
.chips button.on { background: var(--primary-c); color: var(--on-primary-c); border-color: transparent; font-weight: 600; }

.brand { text-align: center; margin: 12px 0 18px; }
.brand img { width: 112px; height: 112px; }
.brand h1 { margin: 8px 0 0; font-size: 22px; }

.cover { width: 48px; height: 68px; border-radius: 6px; object-fit: cover; background: var(--variant); flex: none;
  display: flex; align-items: center; justify-content: center; font-size: 22px; }
.cover.big { width: 110px; height: 156px; font-size: 40px; }
.booklist .card { cursor: pointer; }
.booklist .title { font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (min-width: 560px) { .tiles { grid-template-columns: repeat(4, 1fr); } }
.tile { border-radius: 14px; padding: 10px; min-height: 78px; color: #fff; text-decoration: none; display: flex;
  flex-direction: column; justify-content: space-between; }
.tile b { font-size: 14px; line-height: 1.3; }
.tile small { opacity: .85; font-size: 12px; }

.hscroll { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 6px; }
.hscroll a { flex: none; width: 112px; text-decoration: none; color: inherit; }
.hscroll .cover { width: 112px; height: 160px; border-radius: 12px; font-size: 36px; }
.hscroll .t { font-size: 14px; font-weight: 600; margin-top: 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat { background: var(--primary-c); color: var(--on-primary-c); border-radius: 16px; padding: 12px 6px; text-align: center; }
.stat b { display: block; font-size: 22px; }
.stat small { font-size: 12px; }

.hero { border-radius: 20px; padding: 20px; color: #fff; display: flex; align-items: center; gap: 16px;
  background: linear-gradient(135deg, #0E5A73, #4D7C3A); margin-bottom: 12px; }
.hero img { width: 64px; height: 64px; border-radius: 50%; background: #fff; padding: 4px; }
.hero b { font-size: 20px; }

.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 16px; }
.modal { background: var(--surface); border-radius: 20px; padding: 20px; width: 100%; max-width: 420px; }
.modal h3 { margin: 0 0 8px; }
.modal .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.modal .actions .btn { width: auto; padding: 10px 18px; }

.loading { text-align: center; padding: 40px; color: var(--muted); }
.spinner { width: 28px; height: 28px; border: 3px solid var(--variant); border-top-color: var(--primary); border-radius: 50%;
  animation: spin 1s linear infinite; margin: 0 auto 10px; }
@keyframes spin { to { transform: rotate(360deg); } }
.bank { border-left: 4px solid var(--gold); }
.radio { display: flex; gap: 10px; align-items: flex-start; padding: 10px; border-radius: 12px; border: 1.5px solid var(--outline); margin: 8px 0; cursor: pointer; }
.radio.on { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 6%, transparent); }
.radio input { margin-top: 5px; }

/* ছবির স্লাইড */
.carousel { position: relative; margin-bottom: 12px; }
.slides { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; border-radius: 20px; scrollbar-width: none; }
.slides::-webkit-scrollbar { display: none; }
.slide { flex: 0 0 100%; scroll-snap-align: start; position: relative; aspect-ratio: 16 / 9; background: var(--variant); }
.slide img { width: 100%; height: 100%; object-fit: cover; display: block; }
.slide .caption { position: absolute; left: 0; right: 0; bottom: 0; padding: 28px 16px 26px; color: #fff; font-weight: 600;
  background: linear-gradient(transparent, rgba(0,0,0,.65)); }
.dots { position: absolute; bottom: 10px; left: 0; right: 0; display: flex; justify-content: center; gap: 6px; pointer-events: none; }
.dots span { width: 6px; height: 6px; border-radius: 3px; background: rgba(255,255,255,.5); transition: width .2s; }
.dots span.on { width: 18px; background: #fff; }
/* অনুষ্ঠানের তারিখ */
.datebox { width: 56px; flex: none; border-radius: 12px; background: var(--primary); color: var(--on-primary); text-align: center; padding: 6px 0; }
.datebox b { display: block; font-size: 20px; line-height: 1.2; }
.datebox small { font-size: 12px; }
/* প্রোফাইলের তালিকা-লিংক */
.listlink { display: flex; align-items: center; padding: 12px 2px; color: inherit; text-decoration: none; font-weight: 600;
  border-bottom: 1px solid var(--outline); }
.listlink::after { content: "›"; margin-left: auto; color: var(--muted); font-size: 20px; }
/* লগআউট — হালকা লাল */
.btn.logout { background: color-mix(in srgb, var(--bad) 12%, transparent); color: var(--bad); border-radius: 12px; }
.btn.logout:hover { background: color-mix(in srgb, var(--bad) 18%, transparent); }
.topbar h1.home-link { cursor: pointer; }
/* খোঁজার ঘর উপরে আটকে থাকে (বই কেনা) */
.stickysearch { position: sticky; top: 52px; z-index: 5; background: var(--bg); padding: 4px 0 8px; margin-top: -4px; }
/* ঝুড়ির বাটন নিচে আটকে থাকে */
.basketbar { position: sticky; bottom: 8px; }
button.tile { border: 0; text-align: left; cursor: pointer; font: inherit; width: 100%; }
.chips.wrap { flex-wrap: wrap; overflow: visible; }
