/* CSD Smart Portal — army theme */
:root {
  --olive-900: #1f2410;
  --olive-800: #2c3318;
  --olive-700: #3b4521;
  --olive-600: #4b5320;
  --olive-500: #5f6b2d;
  --khaki: #c3b091;
  --sand: #efe9da;
  --sand-2: #f7f4ec;
  --brass: #c9a227;
  --maroon: #7a1f1f;
  --ink: #1d1f17;
  --muted: #6b6f5e;
  --line: #ddd6c3;
  --radius: 14px;
  --bs-primary: #4b5320;
  --bs-primary-rgb: 75, 83, 32;
  --bs-link-color: #4b5320;
  --bs-link-hover-color: #2c3318;
  --bs-body-font-family: "Barlow", "Noto Sans Devanagari", system-ui, -apple-system, "Segoe UI", sans-serif;
  --bs-body-color: var(--ink);
  --bs-body-bg: var(--sand-2);
}
body { background: var(--sand-2); font-size: 1rem; }
h1, h2, h3, .stencil { font-family: "Saira Stencil One", "Barlow", sans-serif; letter-spacing: .5px; font-weight: 400; }
h4, h5, h6 { font-weight: 700; }
.text-muted { color: var(--muted) !important; }
a { color: var(--olive-600); }

/* buttons */
.btn-primary, .btn-olive { --bs-btn-bg: var(--olive-600); --bs-btn-border-color: var(--olive-600); --bs-btn-hover-bg: var(--olive-800); --bs-btn-hover-border-color: var(--olive-800); --bs-btn-active-bg: var(--olive-900); --bs-btn-color: #fff; --bs-btn-hover-color: #fff; --bs-btn-disabled-bg: var(--olive-500); --bs-btn-disabled-border-color: var(--olive-500); font-weight: 600; }
.btn-brass { --bs-btn-bg: var(--brass); --bs-btn-border-color: var(--brass); --bs-btn-color: #1d1f17; --bs-btn-hover-bg: #b38f1d; --bs-btn-hover-border-color: #b38f1d; font-weight: 700; }
.btn-outline-primary { --bs-btn-color: var(--olive-600); --bs-btn-border-color: var(--olive-600); --bs-btn-hover-bg: var(--olive-600); --bs-btn-hover-border-color: var(--olive-600); --bs-btn-active-bg: var(--olive-700); }
.form-control:focus, .form-select:focus { border-color: var(--olive-500); box-shadow: 0 0 0 .2rem rgba(75, 83, 32, .2); }
.form-check-input:checked { background-color: var(--olive-600); border-color: var(--olive-600); }
.text-bg-primary { background-color: var(--olive-600) !important; }

/* camo header */
.camo {
  background-color: var(--olive-800);
  background-image:
    radial-gradient(ellipse 60px 34px at 12% 30%, rgba(95,107,45,.55) 60%, transparent 62%),
    radial-gradient(ellipse 80px 40px at 38% 70%, rgba(31,36,16,.55) 60%, transparent 62%),
    radial-gradient(ellipse 70px 30px at 66% 25%, rgba(120,104,62,.45) 60%, transparent 62%),
    radial-gradient(ellipse 90px 44px at 88% 75%, rgba(95,107,45,.5) 60%, transparent 62%),
    radial-gradient(ellipse 50px 26px at 52% 45%, rgba(31,36,16,.45) 60%, transparent 62%);
  background-size: 360px 120px;
  color: #fff;
}
.site-header { border-bottom: 4px solid var(--brass); }
.site-header .brand { display: flex; align-items: center; gap: .85rem; color: #fff; text-decoration: none; }
.site-header .brand:hover { color: #fff; }
.emblem { width: 52px; height: 52px; border-radius: 50%; background: var(--brass); color: var(--olive-900); display: grid; place-items: center; font-family: "Saira Stencil One"; font-size: 1.05rem; box-shadow: 0 0 0 3px rgba(255,255,255,.25); flex: 0 0 auto; }
.brand-name { font-family: "Saira Stencil One"; font-size: clamp(1.3rem, 4.6vw, 2.2rem); line-height: 1; text-transform: uppercase; }
.brand-sub { font-size: .82rem; letter-spacing: 2px; text-transform: uppercase; color: var(--khaki); }
.top-nav { background: var(--olive-900); }
.top-nav .nav-link { color: #e9e4d2; font-weight: 600; text-transform: uppercase; font-size: .82rem; letter-spacing: 1px; padding: .7rem .9rem; }
.top-nav .nav-link:hover, .top-nav .nav-link.active { color: var(--brass); }
.top-nav .navbar-toggler { border-color: rgba(255,255,255,.3); }
.top-nav .navbar-toggler-icon { filter: invert(1); }

/* ticker */
.ticker { background: var(--brass); color: var(--olive-900); font-weight: 600; overflow: hidden; white-space: nowrap; font-size: .92rem; }
.ticker .label { position: relative; z-index: 1; background: var(--maroon); color: #fff; padding: .45rem .9rem; text-transform: uppercase; letter-spacing: 1px; font-size: .75rem; flex: 0 0 auto; }
.ticker-track { display: inline-block; padding-left: 1rem; animation: tick 40s linear infinite; }
.ticker:hover .ticker-track { animation-play-state: paused; }
.ticker-track span { margin-right: 3rem; }
@keyframes tick { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .ticker-track { animation: none; } }

/* cards */
.card { border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.card-header { background: transparent; border-bottom: 1px solid var(--line); font-weight: 700; }
.card-mil > .card-header { background: var(--olive-700); color: #fff; border-radius: var(--radius) var(--radius) 0 0; text-transform: uppercase; letter-spacing: 1px; font-size: .9rem; border-bottom: 3px solid var(--brass); }

/* home */
.home-grid { display: grid; grid-template-columns: minmax(0, 380px) minmax(0, 1fr); grid-template-areas: "login notices" "window notices" "info notices"; gap: 1.25rem; align-items: start; }
.home-login { grid-area: login; } .home-notices { grid-area: notices; } .home-info { grid-area: info; } .home-window { grid-area: window; }
.home-info:empty { display: none; }
.notice-list { max-height: 520px; overflow-y: auto; }
@media (max-width: 991.98px) {
  .home-grid { grid-template-columns: minmax(0, 1fr); grid-template-areas: "login" "window" "notices" "info"; gap: .9rem; }
  .notice-list { max-height: 300px; }
  main.container { padding-top: .9rem !important; }
  .home-login .card-body { padding: .9rem 1rem; }
  .emblem { width: 42px; height: 42px; font-size: .85rem; }
}
.form-control::placeholder { text-transform: none; }
.notice-item { padding: .85rem 1rem; border-bottom: 1px dashed var(--line); }
.notice-item:last-child { border-bottom: 0; }
.notice-item .date { font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.notice-item.pinned { background: #fbf6e3; }
.notice-item.urgent { border-left: 4px solid var(--maroon); }
.window-pill { background: var(--sand); border: 1px dashed var(--olive-500); border-radius: 10px; padding: .6rem .8rem; font-size: .9rem; }

/* member/admin shells */
.app-shell { display: flex; min-height: 100vh; }
.sidebar { width: 250px; flex: 0 0 250px; background: var(--olive-900); color: #e9e4d2; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.sidebar .brand { padding: 1rem; display: flex; gap: .6rem; align-items: center; border-bottom: 3px solid var(--brass); }
.sidebar .brand .emblem { width: 40px; height: 40px; font-size: .85rem; }
.sidebar .brand-name { font-size: 1.15rem; }
.sidebar .nav-link { color: #d9d4c1; padding: .55rem 1rem; display: flex; gap: .65rem; align-items: center; border-left: 3px solid transparent; font-weight: 500; }
.sidebar .nav-link:hover { color: #fff; background: rgba(255,255,255,.05); }
.sidebar .nav-link.active { color: #fff; background: rgba(201,162,39,.14); border-left-color: var(--brass); }
.sidebar .nav-head { font-size: .7rem; text-transform: uppercase; letter-spacing: 1.5px; color: var(--khaki); padding: 1rem 1rem .3rem; opacity: .8; }
.main { flex: 1; min-width: 0; }
.topbar { background: #fff; border-bottom: 1px solid var(--line); padding: .6rem 1rem; position: sticky; top: 0; z-index: 10; }
.content { padding: 1.25rem; }
@media (max-width: 991.98px) {
  .sidebar { position: fixed; left: -260px; z-index: 1045; transition: left .2s; }
  .sidebar.open { left: 0; box-shadow: 0 0 40px rgba(0,0,0,.45); }
  .sidebar-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 1040; opacity: 0; pointer-events: none; transition: opacity .2s; }
  body.menu-open .sidebar-backdrop { opacity: 1; pointer-events: auto; }
  body.menu-open { overflow: hidden; }
  .menu-btn { display: inline-flex; align-items: center; gap: .35rem; font-weight: 700; padding: .3rem .75rem; }
  .content { padding: 1rem; }
}
.page-title { font-family: "Saira Stencil One"; font-size: 1.5rem; margin: 0; }

/* stat tiles */
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; height: 100%; }
.stat .v { font-size: 1.9rem; font-weight: 800; line-height: 1.1; }
.stat .l { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .8px; }

/* booking */
.date-strip { display: flex; gap: .5rem; overflow-x: auto; padding-bottom: .4rem; scroll-snap-type: x mandatory; }
.date-chip { flex: 0 0 auto; width: 76px; text-align: center; border: 1px solid var(--line); background: #fff; border-radius: 12px; padding: .45rem .3rem; color: var(--ink); text-decoration: none; scroll-snap-align: start; }
.date-chip .dw { font-size: .7rem; text-transform: uppercase; color: var(--muted); }
.date-chip .dd { font-size: 1.35rem; font-weight: 800; line-height: 1.1; }
.date-chip .dm { font-size: .7rem; text-transform: uppercase; }
.date-chip .dl { font-size: .68rem; font-weight: 700; margin-top: 2px; }
.date-chip.ok .dl { color: #2e7d32; }
.date-chip.full, .date-chip.closed, .date-chip.over { background: #f1efe8; color: #9a9a8c; }
.date-chip.half { border-style: dashed; border-color: var(--brass); }
.date-chip.sel { background: var(--olive-600); border-color: var(--olive-600); color: #fff; }
.date-chip.sel .dw, .date-chip.sel .dl { color: #f0e7c4; }
.slot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .6rem; }
.slot-opt input { position: absolute; opacity: 0; }
.slot-opt label { display: block; border: 2px solid var(--line); background: #fff; border-radius: 12px; padding: .65rem .75rem; cursor: pointer; height: 100%; }
.slot-opt label .t { font-weight: 700; }
.slot-opt label .n { font-size: .82rem; }
.slot-opt input:checked + label { border-color: var(--olive-600); background: #f3f5e6; box-shadow: 0 0 0 3px rgba(75,83,32,.15); }
.slot-opt input:focus-visible + label { outline: 3px solid var(--brass); }
.slot-opt input:disabled + label { opacity: .5; cursor: not-allowed; background: #f1efe8; }
.bar { height: 6px; background: #e7e3d6; border-radius: 3px; overflow: hidden; margin-top: .35rem; }
.bar > i { display: block; height: 100%; background: var(--olive-500); }
.bar.warn > i { background: var(--brass); }
.bar.low > i { background: var(--maroon); }
.cat-tabs .btn { border-radius: 999px; }

/* token */
.token-card { max-width: 440px; margin: 0 auto; background: #fff; border: 2px solid var(--olive-700); border-radius: 18px; overflow: hidden; }
.token-card .th { padding: 1rem; text-align: center; }
.token-card .serial { font-family: "Saira Stencil One"; font-size: 3rem; line-height: 1; color: var(--olive-700); }
.token-card .code { font-family: ui-monospace, Menlo, monospace; font-size: 1.15rem; letter-spacing: 3px; font-weight: 700; }
.token-card dl { display: grid; grid-template-columns: auto 1fr; gap: .3rem .9rem; margin: 0; }
.token-card dt { color: var(--muted); font-weight: 500; }
.token-card dd { margin: 0; font-weight: 700; }
#qr { display: inline-block; padding: 8px; background: #fff; border: 1px solid var(--line); border-radius: 10px; }
.token-cancelled { position: relative; }
.token-cancelled::after { content: "CANCELLED"; position: absolute; inset: 40% 0 auto; text-align: center; font-family: "Saira Stencil One"; font-size: 3rem; color: rgba(122,31,31,.35); transform: rotate(-14deg); pointer-events: none; }

/* calendar */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal .h { font-size: .72rem; text-transform: uppercase; text-align: center; color: var(--muted); font-weight: 700; }
.cal .d { min-height: 64px; border-radius: 8px; background: #fff; border: 1px solid var(--line); padding: 4px 6px; font-size: .78rem; }
.cal .d .n { font-weight: 800; }
.cal .d.closed { background: #f6e6e6; border-color: #e3c4c4; }
.cal .d.half { background: #fbf3d6; border-color: #ead9a0; }
.cal .d.today { outline: 2px solid var(--olive-600); }
.cal .d.open { box-shadow: inset 0 -3px 0 #6b8e23; }
.cal .d.blank { background: transparent; border: 0; }
.cal .d .r { font-size: .68rem; line-height: 1.15; color: #5a4a2a; }
@media (max-width: 575.98px) { .cal .d { min-height: 48px; font-size: .7rem; padding: 2px 3px; } .cal .d .r { display: none; } }

.table > :not(caption) > * > * { padding: .55rem .6rem; }
.table thead th { font-size: .78rem; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); background: var(--sand); }
.footer { color: var(--muted); font-size: .85rem; }
.honey { position: absolute; left: -9999px; }
.mode-card { border: 2px solid var(--line); border-radius: 12px; padding: .9rem; cursor: pointer; height: 100%; display: block; background: #fff; }
.mode-card:has(input:checked) { border-color: var(--olive-600); background: #f3f5e6; }

@media print {
  .no-print, .sidebar, .topbar, .site-header, .top-nav, .ticker, footer { display: none !important; }
  body { background: #fff; }
  .content { padding: 0; }
  .card { border: 0; box-shadow: none; }
}

/* Devanagari & other scripts: stencil font has no Indic glyphs, so use Noto for headings in those languages */
html:not([lang="en"]) h1, html:not([lang="en"]) h2, html:not([lang="en"]) h3, html:not([lang="en"]) .page-title,
html:not([lang="en"]) .card-mil > .card-header { font-family: "Noto Sans Devanagari", "Barlow", sans-serif; font-weight: 700; letter-spacing: 0; }

/* admin topbar member search with suggestions */
.topsearch { position: relative; max-width: 420px; min-width: 0; }
.topsearch > .bi-search { position: absolute; left: .6rem; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: .85rem; pointer-events: none; }
.topsearch input { padding-left: 1.9rem; }
.suggest-list { position: absolute; top: calc(100% + 4px); left: 0; width: max(100%, 340px); max-width: calc(100vw - 24px); background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.15); z-index: 1050; max-height: 70vh; overflow-y: auto; }
.suggest-item { display: block; padding: .55rem .75rem; border-bottom: 1px solid #f0ece0; color: var(--ink); text-decoration: none; }
.suggest-item:last-child { border-bottom: 0; }
.suggest-item:hover, .suggest-item.active { background: #f3f5e6; color: var(--ink); }
.suggest-item .nm { font-weight: 700; }
.suggest-item .an { font-family: ui-monospace, Menlo, monospace; font-weight: 700; letter-spacing: 1px; }
.suggest-item .why { font-size: .7rem; text-transform: uppercase; letter-spacing: .5px; color: var(--olive-600); background: #eef1dc; border-radius: 4px; padding: 0 .35rem; }
.suggest-empty { padding: .7rem .75rem; color: var(--muted); font-size: .9rem; }
@media (max-width: 575.98px) {
  .topbar { flex-wrap: nowrap; } .topsearch input::placeholder { font-size: .8rem; }
  .suggest-list { position: fixed; left: 10px; right: 10px; top: 56px; width: auto; max-width: none; }
}

/* member portal: bottom tab bar on phones (space is reserved so it never covers content) */
.bottom-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1030; display: flex; background: #fff; border-top: 1px solid var(--line);
  box-shadow: 0 -4px 16px rgba(0,0,0,.06); padding-bottom: env(safe-area-inset-bottom); }
.bottom-nav a, .bottom-nav button { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: 60px; padding: 6px 2px; border: 0; background: none; color: var(--muted); font-size: .72rem; font-weight: 600; text-decoration: none; line-height: 1.1; }
.bottom-nav i { font-size: 1.35rem; line-height: 1; }
.bottom-nav span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bottom-nav .active { color: var(--olive-700); }
.bottom-nav .active i { background: rgba(201,162,39,.25); border-radius: 999px; padding: 2px 16px; }
@media (max-width: 991.98px) {
  body:has(.bottom-nav) .content { padding-bottom: calc(60px + 1.5rem + env(safe-area-inset-bottom)); }
  body:has(.bottom-nav) .sidebar { padding-bottom: calc(60px + env(safe-area-inset-bottom)); }
}

.more-notices summary { cursor: pointer; color: var(--olive-600); list-style: none; border-top: 1px dashed var(--line); }
.more-notices summary::-webkit-details-marker { display: none; }
.more-notices summary::before { content: "▸ "; }
.more-notices[open] summary::before { content: "▾ "; }
html { scroll-padding-top: 70px; }

.updated-stamp { display: inline-block; background: #fbf3d6; border: 1px solid #ead9a0; border-radius: 10px; padding: .4rem .8rem; font-size: 1.05rem; }
.updated-stamp b { font-weight: 800; color: var(--olive-800); }

/* star rating (right-to-left so CSS can colour the chosen star and the ones before it) */
.stars { display: inline-flex; flex-direction: row-reverse; gap: .15rem; }
.stars input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.stars label { font-size: 2.3rem; line-height: 1; color: #d6d0bd; cursor: pointer; padding: 0 .1rem; }
.stars input:checked ~ label, .stars label:hover, .stars label:hover ~ label { color: var(--brass); }
.stars input:focus-visible + label { outline: 2px solid var(--olive-600); border-radius: 4px; }

/* Large text mode (members / visitors): everything sized in rem grows with the root font size */
html.big-text { font-size: 120%; }
html.big-text .btn { padding-top: .55rem; padding-bottom: .55rem; }
html.big-text .form-control, html.big-text .form-select { min-height: 3rem; }
html.big-text .small, html.big-text small, html.big-text .form-text { font-size: .95em; }
html.big-text .bottom-nav a, html.big-text .bottom-nav button { font-size: .8rem; min-height: 68px; }
html.big-text body:has(.bottom-nav) .content { padding-bottom: calc(68px + 2rem); }
.big-toggle { line-height: 1; display: inline-flex; align-items: baseline; gap: 1px; }
.big-toggle[aria-pressed="true"] { background: var(--brass); border-color: var(--brass); color: var(--olive-900); }

/* header always fits on narrow phones (also in large-text mode) */
.site-header .brand { min-width: 0; flex: 1 1 auto; }
.site-header .brand > span:last-child { min-width: 0; }
.site-header .container > .d-flex { flex: 0 0 auto; }
@media (max-width: 430px) {
  .site-header .lang-name, .topbar .lang-name { display: none; }
  html.big-text .site-header .brand-name { font-size: 1.15rem; }
  html.big-text .site-header .emblem { width: 38px; height: 38px; font-size: .75rem; }
}

@media (min-width:768px){.border-md-0{border:0!important}}
