/* Khujedei business app. Brand (docs/BRAND.md): Navy #142D4E, Teal #0F8B83, Amber #F4B544, background #F7F9FC, text #263445. */
:root {
  --navy: #142D4E; --navy-2: #1D3B63; --teal: #0F8B83; --teal-d: #0B6F69; --teal-bg: #E6F4F2; --amber: #F4B544; --amber-bg: #FEF5E1;
  --bg: #F7F9FC; --text: #263445; --muted: #6B7A90; --line: #E2E8F0; --card: #FFFFFF;
  --red: #DC2626; --red-bg: #FDECEA; --green: #16A36A; --blue: #3978C6; --pending: #D99522;
  --wa: #25D366; --fb: #0866FF; --radius: 12px;
  --font: Inter, "Hind Siliguri", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Bengali", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 14px/1.5 var(--font); -webkit-text-size-adjust: 100%; }
a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 20px; margin: 0 0 14px; color: var(--navy); }
h2 { font-size: 16px; margin: 0 0 10px; color: var(--navy); }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.hidden { display: none !important; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.grow { flex: 1; min-width: 0; }

/* buttons and inputs */
button { font: inherit; border: 0; border-radius: 10px; padding: 8px 14px; cursor: pointer; background: var(--teal); color: #fff; font-weight: 600; min-height: 38px; }
button:hover { background: var(--teal-d); }
button:disabled { opacity: .55; cursor: default; }
button.ghost { background: transparent; color: var(--teal); border: 1px solid var(--teal); }
button.ghost:hover { background: var(--teal-bg); }
button.plain { background: transparent; color: var(--text); border: 1px solid var(--line); font-weight: 500; }
button.plain:hover { background: #EEF2F7; }
button.amber { background: var(--amber); color: var(--navy); }
button.amber:hover { background: #E9A62E; }
button.danger { background: var(--red); }
button.small { padding: 4px 10px; font-size: 12.5px; min-height: 30px; }
button.icon { background: transparent; color: inherit; padding: 6px 8px; min-height: 0; font-size: 18px; line-height: 1; }
input, select, textarea { font: inherit; color: var(--text); border: 1px solid #CBD5E1; border-radius: 10px; padding: 9px 11px; background: #fff; width: 100%; min-height: 40px; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(15,139,131,.25); border-color: var(--teal); }
label { display: block; font-size: 12.5px; color: var(--muted); margin: 10px 0 4px; }
.field { margin-bottom: 4px; }
.check { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 13.5px; margin: 10px 0; }
.check input { width: auto; min-height: 0; }

/* cards, pills, messages */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 14px; }
.pill { display: inline-block; padding: 1px 8px; border-radius: 99px; font-size: 11.5px; font-weight: 600; background: #EEF2F7; color: var(--muted); white-space: nowrap; }
.pill.ok { background: #E3F6EC; color: #0F7A4C; }
.pill.warn { background: var(--amber-bg); color: #9A6A0B; }
.pill.bad { background: var(--red-bg); color: var(--red); }
.pill.info { background: #E7F0FB; color: var(--blue); }
.pill.ai { background: #EDE9FE; color: #6D28D9; }
.msg { border-radius: 10px; padding: 10px 12px; margin: 10px 0; font-size: 13.5px; }
.msg.err { background: var(--red-bg); color: #9B1C1C; }
.msg.ok { background: #E3F6EC; color: #0F7A4C; }
.msg.info { background: #E7F0FB; color: #1E4E8C; }
.msg.warn { background: var(--amber-bg); color: #7A5408; }
#toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 6px; align-items: center; pointer-events: none; }
#toast div { background: var(--navy); color: #fff; padding: 10px 16px; border-radius: 10px; box-shadow: 0 6px 24px rgba(20,45,78,.25); font-size: 13.5px; max-width: 92vw; }
#toast div.err { background: var(--red); }

/* login pages */
.auth { min-height: 100%; display: flex; align-items: center; justify-content: center; padding: 24px 14px; }
.auth .box { width: 100%; max-width: 400px; }
.auth .logo { display: flex; align-items: center; gap: 10px; justify-content: center; margin-bottom: 18px; font-weight: 700; font-size: 22px; color: var(--navy); }
.auth .logo img { width: 40px; height: 40px; border-radius: 10px; }
.auth .card { padding: 24px; }
.auth button[type=submit] { width: 100%; margin-top: 16px; }
.auth .links { display: flex; justify-content: space-between; margin-top: 14px; font-size: 13px; }

/* app shell */
.shell { display: grid; grid-template-columns: 220px 1fr; height: 100vh; height: 100dvh; }
.side { background: var(--navy); color: #fff; padding: 14px 10px; display: flex; flex-direction: column; gap: 2px; min-height: 0; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 16px; padding: 2px 8px 6px; }
.brand img { width: 28px; height: 28px; border-radius: 7px; }
.biz { font-size: 12px; color: #9FB0C6; padding: 0 8px 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side a { color: #C9D4E3; padding: 9px 10px; border-radius: 9px; display: flex; align-items: center; gap: 10px; }
.side a:hover { background: rgba(255,255,255,.08); color: #fff; text-decoration: none; }
.side a.on { background: var(--teal); color: #fff; }
.side a .count { margin-left: auto; background: var(--amber); color: var(--navy); border-radius: 99px; font-size: 11px; font-weight: 700; padding: 0 7px; }
.side .spacer { flex: 1; }
.side .me { border-top: 1px solid rgba(255,255,255,.12); padding: 10px 8px 2px; font-size: 12.5px; color: #C9D4E3; }
.side .me button { margin-top: 6px; }
.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.top { display: flex; align-items: center; gap: 8px; padding: 10px 18px; background: #fff; border-bottom: 1px solid var(--line); min-height: 56px; }
.top h1 { margin: 0; font-size: 18px; }
.content { flex: 1; overflow: auto; padding: 18px; min-height: 0; }
.content.flush { padding: 0; overflow: hidden; display: flex; }
.trial { background: var(--amber-bg); color: #7A5408; padding: 6px 18px; font-size: 13px; border-bottom: 1px solid #F3DFB2; }
.bell { position: relative; }
.bell .dot { position: absolute; top: 2px; right: 2px; background: var(--red); color: #fff; font-size: 10px; font-weight: 700; border-radius: 99px; padding: 0 5px; line-height: 16px; }
.panel { position: absolute; right: 12px; top: 54px; width: min(380px, 94vw); max-height: 70vh; overflow: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 12px 40px rgba(20,45,78,.18); z-index: 40; }
.panel .item { padding: 10px 14px; border-bottom: 1px solid var(--line); cursor: pointer; }
.panel .item:hover { background: #F4F7FB; }
.panel .item.unread { background: #F2FAF9; }
.panel .item b { display: block; color: var(--navy); font-size: 13.5px; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.tabs button { background: transparent; color: var(--muted); border: 1px solid transparent; font-weight: 600; padding: 5px 10px; min-height: 32px; }
.tabs button.on { background: var(--teal-bg); color: var(--teal-d); border-color: #BFE3DE; }

/* inbox */
.inbox { display: grid; grid-template-columns: 340px 1fr; width: 100%; min-height: 0; }
.list { border-right: 1px solid var(--line); background: #fff; display: flex; flex-direction: column; min-height: 0; }
.list .head { padding: 10px 12px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.list .items { overflow: auto; flex: 1; }
.conv { display: flex; gap: 10px; padding: 11px 12px; border-bottom: 1px solid #EEF2F6; cursor: pointer; }
.conv:hover { background: #F6F9FC; }
.conv.on { background: var(--teal-bg); }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: #DCE5EF; color: var(--navy); display: flex; align-items: center; justify-content: center; font-weight: 700; flex: none; position: relative; }
.avatar .ch { position: absolute; right: -3px; bottom: -3px; width: 18px; height: 18px; border-radius: 50%; border: 2px solid #fff; font-size: 9px; font-weight: 800; color: #fff; display: flex; align-items: center; justify-content: center; }
.ch.WHATSAPP { background: var(--wa); } .ch.MESSENGER { background: var(--fb); } .ch.WEBCHAT { background: var(--teal); } .ch.CHAT_LINK { background: var(--navy-2); } .ch.APP, .ch.PORTAL { background: var(--amber); color: var(--navy); }
.conv .name { font-weight: 600; color: var(--navy); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv .prev { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv .time { font-size: 11px; color: var(--muted); white-space: nowrap; }
.conv .unread { background: var(--teal); color: #fff; border-radius: 99px; font-size: 11px; font-weight: 700; padding: 0 7px; margin-left: 6px; }
.chat { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--bg); }
.chat .bar { background: #fff; border-bottom: 1px solid var(--line); padding: 10px 14px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.chat .bar .who { min-width: 0; flex: 1; }
.chat .bar .who b { color: var(--navy); font-size: 15px; }
.chat .stream { flex: 1; overflow: auto; padding: 16px 14px; display: flex; flex-direction: column; gap: 6px; }
.bubble { max-width: min(78%, 620px); padding: 8px 12px; border-radius: 14px; background: #fff; border: 1px solid var(--line); white-space: pre-wrap; word-break: break-word; align-self: flex-start; }
.bubble.out { align-self: flex-end; background: var(--teal-bg); border-color: #C6E7E2; }
.bubble.out.ai { background: #F3F0FF; border-color: #E0D8FB; }
.bubble.out.action { background: #FFF7E6; border-color: #F6E1B0; }
.bubble.system { align-self: center; background: transparent; border: 0; color: var(--muted); font-size: 12px; }
.bubble .meta { font-size: 11px; color: var(--muted); margin-top: 3px; display: flex; gap: 6px; justify-content: flex-end; }
.bubble .by { font-size: 11px; font-weight: 700; color: var(--muted); margin-bottom: 2px; }
.bubble .btns { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.bubble .btns span { border: 1px solid var(--teal); color: var(--teal); border-radius: 99px; padding: 1px 10px; font-size: 12px; }
.bubble img { max-width: 260px; max-height: 260px; border-radius: 8px; display: block; margin-top: 4px; }
.bubble audio { margin-top: 4px; max-width: 260px; }
.note { align-self: stretch; background: var(--amber-bg); border: 1px dashed #EBC97A; border-radius: 10px; padding: 8px 12px; font-size: 13px; }
.note .by { font-size: 11px; font-weight: 700; color: #9A6A0B; }
.compose { background: #fff; border-top: 1px solid var(--line); padding: 10px 12px; }
.compose textarea { min-height: 44px; max-height: 160px; resize: none; }
.compose.notes textarea { background: var(--amber-bg); }
.suggest { border: 1px solid var(--line); border-radius: 10px; background: #fff; margin-bottom: 6px; max-height: 180px; overflow: auto; }
.suggest div { padding: 7px 10px; cursor: pointer; font-size: 13px; }
.suggest div:hover, .suggest div.on { background: var(--teal-bg); }
.empty { margin: auto; text-align: center; color: var(--muted); padding: 40px 20px; }
.typing { font-size: 12px; color: var(--muted); padding: 0 16px 6px; min-height: 18px; }

/* bookings */
.blist { display: flex; flex-direction: column; gap: 10px; max-width: 980px; }
.bk { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.bk .num { font-weight: 700; color: var(--navy); }
.bk .acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; align-items: flex-start; }
table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); font-size: 13.5px; vertical-align: top; }
th { background: #F4F7FB; color: var(--muted); font-weight: 600; font-size: 12px; }

/* dialogs */
.backdrop { position: fixed; inset: 0; background: rgba(20,45,78,.45); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 16px; }
.dialog { background: #fff; border-radius: 14px; padding: 20px; width: min(460px, 100%); max-height: 90vh; overflow: auto; }
.dialog h2 { margin-bottom: 6px; }
.dialog .acts { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }

/* phone and tablet */
.menu-btn, .back-btn { display: none; }
@media (max-width: 900px) {
  .inbox { grid-template-columns: 1fr; }
  .inbox.open .list { display: none; }
  .inbox:not(.open) .chat { display: none; }
  .back-btn { display: inline-flex; }
}
@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 auto 0 0; width: 250px; z-index: 45; transform: translateX(-100%); transition: transform .2s; }
  .shell.nav .side { transform: none; box-shadow: 0 0 0 100vmax rgba(20,45,78,.4); }
  .menu-btn { display: inline-flex; }
  .content { padding: 12px; }
  .top { padding: 8px 10px; }
  .bk { grid-template-columns: 1fr; }
  .bk .acts { justify-content: flex-start; }
  .bubble { max-width: 88%; }
}

/* hotel */
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.week label { margin-top: 0; }
.calwrap { overflow: auto; border-radius: var(--radius); }
table.cal { border-collapse: separate; border-spacing: 0; min-width: 100%; }
table.cal th, table.cal td { padding: 6px 4px; text-align: center; font-size: 12px; border-bottom: 1px solid var(--line); border-right: 1px solid #EEF2F6; white-space: nowrap; }
table.cal th.room { text-align: left; padding-left: 10px; position: sticky; left: 0; background: #fff; z-index: 1; font-size: 13px; color: var(--navy); min-width: 110px; }
table.cal thead th { position: sticky; top: 0; z-index: 2; }
table.cal thead th .d { font-size: 15px; color: var(--navy); }
table.cal thead th.we { background: #EEF7F6; }
table.cal thead th.today .d { color: #fff; background: var(--teal); border-radius: 99px; display: inline-block; min-width: 24px; }
table.cal td.n { cursor: pointer; min-width: 58px; }
table.cal td.n:hover { outline: 2px solid var(--teal); outline-offset: -2px; }
td.n.FREE { background: #fff; color: var(--text); }
td.n.FREE.ov { color: var(--teal-d); font-weight: 700; }
td.n.HELD { background: #FFF4DC; color: #8A5A00; }
td.n.BOOKED { background: #DDF3E8; color: #0F6B43; font-weight: 600; }
td.n.BLOCKED { background: #ECEFF3; color: #6B7A90; }
td.n.EXTERNAL { background: #E7EEFB; color: #2F5FA6; }
.legend { display: inline-block; margin-right: 8px; padding: 1px 8px; border-radius: 6px; border: 1px solid var(--line); }
.legend.HELD { background: #FFF4DC; } .legend.BOOKED { background: #DDF3E8; } .legend.BLOCKED { background: #ECEFF3; } .legend.EXTERNAL { background: #E7EEFB; }
@media (max-width: 760px) { .week { grid-template-columns: repeat(4, 1fr); } }
