/* ============================================================
   SMS 26 - application styles
   Chat page layout copied from capacity26ar/tt_css/brand.css
   (the learn page), so the history page is a pure chat page.
   Bubble colours follow the application logo palette
   (orange #ffa500 / cream #fff5e6 / dark #382801).
   ============================================================ */

.ct_chat_page {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.ct_chat_page > .b_chat_history {
    flex: 1 1 auto;
    height: auto;
    min-height: 0;
    overflow-y: auto;
    padding: 10px;
}

.ct_chat_page > .b_hist_spc {
    flex: 0 0 auto;
    min-height: 10px;
}

.ct_chat_page .k_chatline {
    width: 100%;
    clear: both;
    margin: 6px 0;
}

/* outgoing bubble - very faint logo orange */
.ct_chat_page .k_userbot {
    max-width: 82%;
    box-sizing: border-box;
    padding: 8px 12px;
    line-height: 1.45;
    font-size: 14px;
    background-color: #fff8ee;
    color: #382801;
    border: 1px solid #ffe6c2;
    border-radius: 10px 0 10px 10px;
}

/* incoming bubble - very faint logo cream */
.ct_chat_page .k_sysbot {
    max-width: 82%;
    box-sizing: border-box;
    display: inline-block;
    padding: 8px 12px;
    line-height: 1.45;
    font-size: 14px;
    background-color: #fffdf9;
    color: #382801;
    border: 1px solid #f2e6d5;
    border-radius: 0 10px 10px 10px;
}

/* suggestion chips line */
.ct_sugg {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    padding: 8px 10px;
    border-top: 1px solid #e0e0e0;
    background-color: #ffffff;
    flex: 0 0 auto;
    min-height: 34px;
}

.ct_sugg::-webkit-scrollbar {
    display: none;
}

.ct_sugg_chip {
    flex: 0 0 auto;
    padding: 5px 12px;
    border: 1px solid #ffcf80;
    border-radius: 20px;
    background-color: #fff5e6;
    color: #382801;
    white-space: nowrap;
    font-size: 12px;
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
}

.ct_sugg_chip:active {
    background-color: #ffe5cc;
}

/* day divider */
.ct_day {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 10px 0;
}

.ct_day::before,
.ct_day::after {
    content: "";
    flex: 1;
    border-top: 1px dashed #b9b9b9;
}

.ct_day span {
    font-size: 12px;
    color: #8a8a8a;
    padding: 0 10px;
    white-space: nowrap;
}

/* right panel: gateway status icon (green connected / red disconnected) */
.b_gw_on { color: #1a9e3a; }
.b_gw_off { color: #c62828; }
.b_gw_on svg,
.b_gw_off svg { stroke: currentColor; }

/* right panel: sending icon spins while a batch is moving (reuses ttstyles spin) */
.b_spin svg { animation: spin 2s linear infinite; transform-origin: center; }

/* right panel: fit the icon SVG to its square cell */
.b_svgfit svg { width: 100%; height: 100%; }

/* right panel: heartbeat ECG scrolls right-to-left while the gateway is connected */
.b_ecgbox { overflow: hidden; }
.b_ecg { display: block; width: 200%; height: 100%; }
.b_beat .b_ecg { animation: b_ecgscroll 3s linear infinite; }
@keyframes b_ecgscroll {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

/* right panel: batch percentage shown over the sending icon */
.b_pctwrap { position: relative; }
.b_pct {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: bold;
    color: #382801;
    pointer-events: none;
}

/* dashboard tile (mobile home, capacity26ar style) */
.b_dash_tile {
    position: relative;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

/* dashboard badge for counts on a tile */
.b_dash_badge {
    position: absolute;
    top: 6px;
    right: 6px;
    min-width: 20px;
    height: 20px;
    padding: 0 4px;
    background-color: #f44336;
    color: #ffffff;
    border-radius: 50%;
    font-size: 10px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

/* mobile dashboard: kmake_dashboard cards become full width */
.b_mobdash .w_33p { width: 100%; }

/* mobile page header row */
.b_mobhead {
    border-bottom: 1px solid #e0e0e0;
    background-color: #ffffff;
}

/* BF logo proper colours (Business-Folio): orange polygons 1 & 3, black polygon 2 */
svg[aria-label="Business-Folio"] polygon:nth-child(1),
svg[aria-label="Business-Folio"] polygon:nth-child(3) {
    fill: #ffa500;
    stroke: #ffa500;
}
svg[aria-label="Business-Folio"] polygon:nth-child(2) {
    fill: #000000;
    stroke: #000000;
}

/* mobile list page navigation (aisales control style) */
.b_mobpg {
    height: 10vw;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--b_fs_sm);
    box-sizing: border-box;
    background-color: #ffa500;
    border: 1px solid #ffa500;
    color: #000000;
    font-weight: bold;
}
.b_mobpg_input {
    width: 100%;
    height: 10vw;
    text-align: center;
    border: 1px solid #cbd1d0;
    border-radius: 5px;
    font-size: var(--b_fs_sm);
    box-sizing: border-box;
}

/* chat load-more line */
.b_moreline {
    width: 100%;
    float: left;
    padding: 2vw;
    text-align: center;
    color: #888888;
    font-size: var(--b_fs_sm);
}

/* mobile chat input bar */
.b_mobchatbar {
    width: 100%;
    float: left;
    padding: 1vw;
    box-sizing: border-box;
}
.b_mobchatbar .b_mob_area {
    height: 12vw;
}

/* mobile chart container */
.b_mobchart {
    height: 40vw;
}

/* calendar month header cells (sales_agent design) */
.b_cal_mh {
    width: 14.28%;
    height: 9vw;
    float: left;
    font-size: 3vw;
    display: flex;
    align-items: center;
    justify-content: center;
}
.b_cal_blank {
    height: 11vw;
}
.b_cal_day {
    width: 14.28%;
    height: 11vw;
    float: left;
    text-align: center;
    font-size: 3vw;
    border: 1px solid #e0e0e0;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.b_cal_circle {
    width: 9vw;
    height: 9vw;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}
.b_cal_today_outline {
    outline: 2px solid #425451;
}

/* div option groups (replace html select) */
.b_optrow {
    width: 100%;
    float: left;
    display: flex;
    flex-wrap: wrap;
    gap: 3vw;
    padding: 1vw 0;
}
.b_opt {
    display: flex;
    align-items: center;
    gap: 2vw;
}
.b_opt .b_check_icon {
    margin: 0;
}
.b_optlabel {
    font-size: var(--b_fs_body);
    color: #333333;
}

/* calendar time arrows: two centered columns, theme buttons */
.b_timewrap {
    width: 100%;
    float: left;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 8vw;
    padding: 2vw 0;
}
.b_timecol {
    width: 30vw;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.b_timebtn {
    width: 10vw;
    height: 10vw;
}
.b_timebtn svg {
    width: 5vw;
    height: 5vw;
    display: block;
}
.b_timeval {
    font-size: var(--b_fs_2xl);
    font-weight: bold;
    padding: 3vw 0;
}

/* contact picker: div/svg checkbox and centered list rows */
.b_hide { display: none; }
.b_check_icon {
    width: 10.5vw;
    height: auto;
    aspect-ratio: 1 / 1;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}
.b_check_icon svg { width: 100%; height: 100%; display: block; }
.b_check_icon .b_chk_on { display: none; }
.b_check_icon.b_checked .b_chk_on { display: block; }
.b_check_icon.b_checked .b_chk_off { display: none; }
.b_pick_row {
    width: 100%;
    min-height: 14vw;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 2vw;
    border-bottom: 1px solid #eeeeee;
    box-sizing: border-box;
    text-align: left;
}
.b_pick_cb {
    width: 10%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.b_pick_info {
    width: 90%;
    text-align: left;
}

/* recipients / schedule field with the square orange side button */
.b_mob_to {
    float: left;
    width: calc(100% - 12vw);
    min-height: 25vw;
    height: auto;
    font-size: var(--b_fs_body);
    padding: 2vw;
    box-sizing: border-box;
    border: 1px solid #cbd1d0;
    border-radius: 6px;
    background-color: #ffffff;
}
.b_mob_sched {
    float: left;
    width: calc(100% - 12vw);
    height: 10vw;
    font-size: var(--b_fs_body);
    padding: 0 2vw;
    box-sizing: border-box;
    border: 1px solid #cbd1d0;
    border-radius: 6px;
    background-color: #ffffff;
}
.b_mob_sidebtn {
    float: right;
    width: 10vw;
    height: 10vw;
    margin-left: 2vw;
    background-color: #ffa500;
    border: 1px solid #ffa500;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

/* message box fills the remaining page height (5 lines minimum) */
.b_mob_msg {
    width: 100%;
    flex: 1 1 auto;
    min-height: 28vw;
    height: auto;
    box-sizing: border-box;
}

/* rows that hold a 90% field and a 10% action button */
.b_mob_rowline {
    width: 100%;
    float: left;
    overflow: hidden;
}

/* profile circle icon on the mobile home */
.b_profile_circle {
    border: 2px solid #ffffff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}


/* ============================================================
   Mobile typography scale (capacity26ar reference)
   Mobile pages use these sizes, never the desktop px sizes.
   ============================================================ */
:root {
    --b_fs_xs: 3vw;
    --b_fs_sm: 3.5vw;
    --b_fs_body: 4vw;
    --b_fs_md: 4.6vw;
    --b_fs_lg: 5vw;
    --b_fs_xl: 6vw;
    --b_fs_2xl: 7.5vw;
}
.b_fs_xs { font-size: var(--b_fs_xs); }
.b_fs_sm { font-size: var(--b_fs_sm); }
.b_fs_body { font-size: var(--b_fs_body); }
.b_fs_md { font-size: var(--b_fs_md); }
.b_fs_lg { font-size: var(--b_fs_lg); }
.b_fs_xl { font-size: var(--b_fs_xl); }
.b_fs_2xl { font-size: var(--b_fs_2xl); }

/* mobile title bar (framework header, capacity26ar reference) */
.b_titlebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    height: 13vw;
    z-index: 20;
    display: none;
    background-color: #ffffff;
    border-bottom: 1px solid #e0e0e0;
}
.b_title_menu {
    width: 15%;
    height: 100%;
    float: left;
    padding: 3vw;
    box-sizing: border-box;
}
.b_title_text {
    width: 70%;
    height: 100%;
    float: left;
    overflow: hidden;
    font-size: var(--b_fs_md);
    padding-top: 4vw;
    text-align: center;
    box-sizing: border-box;
}
.b_title_close {
    width: 15%;
    height: 100%;
    float: right;
    padding: 4vw;
    box-sizing: border-box;
}

/* framework close button above the mobile title bar */
.b_close {
    z-index: 30;
    color: #444444;
}

/* mobile inputs and buttons: vw proportions, not desktop px */
.b_mob_input {
    width: 100%;
    height: 12vw;
    font-size: var(--b_fs_body);
    padding: 0 2vw;
    box-sizing: border-box;
    border: 1px solid #cbd1d0;
    border-radius: 6px;
    background-color: #ffffff;
}
.b_mob_area {
    width: 100%;
    height: 30vw;
    font-size: var(--b_fs_body);
    padding: 2vw;
    box-sizing: border-box;
    border: 1px solid #cbd1d0;
    border-radius: 6px;
    background-color: #ffffff;
}
.b_mob_btn {
    width: 100%;
    padding: 3vw;
    font-size: var(--b_fs_md);
    text-align: center;
    border: 1px solid #ffa500;
    border-radius: 6px;
    background-color: #ffa500;
    color: #000000;
    font-weight: bold;
    box-sizing: border-box;
    display: block;
    text-decoration: none;
}
.b_mob_row {
    width: 100%;
    float: left;
    padding: 2.5vw;
    border-bottom: 1px solid #eeeeee;
    box-sizing: border-box;
    overflow: hidden;
}
.b_mob_sec {
    width: 100%;
    float: left;
    padding: 2vw;
    box-sizing: border-box;
}


/* mobile full-height form page (send sms) */
.b_mob_fixed {
    flex: 0 0 auto;
}
.b_mobpage_fill {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 100%;
}
.b_mobform {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 2vw;
    box-sizing: border-box;
}
.b_mobfoot {
    flex: 0 0 auto;
    padding: 2vw;
    box-sizing: border-box;
}

/* mobile pager (sales_agent pattern) */
.b_mobpager {
    width: 100%;
    float: left;
    padding: 2vw;
    box-sizing: border-box;
}
.b_mobpager .b_mob_btn {
    padding: 2vw 0;
    font-size: var(--b_fs_sm);
}

