/* Essence Cleaning portal — brand layer over Bootstrap 5. Colors from essencecleaning.org. */
:root {
  --es-green: #708F3C;
  --es-green-dark: #425728;
  --es-green-light: #93C13E;
  --es-charcoal: #232829;
  --es-bg: #f6f8f3;
  --bs-primary: #5a7530;            /* darker than brand green for 4.5:1 text contrast on white */
  --bs-primary-rgb: 90, 117, 48;
  --bs-link-color: #4e6a29;
  --bs-link-color-rgb: 78, 106, 41;
  --bs-link-hover-color: #425728;
  --bs-body-color: #232829;
  --bs-body-font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
body.es-body { background: var(--es-bg); }

.btn-primary, .btn-success {
  --bs-btn-bg: #5a7530; --bs-btn-border-color: #5a7530;
  --bs-btn-hover-bg: #425728; --bs-btn-hover-border-color: #425728;
  --bs-btn-active-bg: #384a22; --bs-btn-active-border-color: #384a22;
  --bs-btn-disabled-bg: #8aa060; --bs-btn-disabled-border-color: #8aa060;
}
.btn-outline-primary {
  --bs-btn-color: #4e6a29; --bs-btn-border-color: #5a7530;
  --bs-btn-hover-bg: #5a7530; --bs-btn-hover-border-color: #5a7530; --bs-btn-hover-color: #fff;
  --bs-btn-active-bg: #425728; --bs-btn-active-border-color: #425728;
}
.form-control:focus, .form-select:focus, .form-check-input:focus {
  border-color: var(--es-green-light);
  box-shadow: 0 0 0 .25rem rgba(112, 143, 60, .25);
}
.form-check-input:checked { background-color: #5a7530; border-color: #5a7530; }

/* Sandbox banner */
.es-sandbox-bar {
  background: #fff3cd; color: #664d03; font-size: .85rem; text-align: center;
  padding: .3rem 1rem; border-bottom: 1px solid #ffe69c;
}

/* Top bar */
.es-navbar { background: #fff; }
.es-logo { height: 40px; width: auto; }
.es-navbar .nav-link { color: var(--es-charcoal); border-radius: .5rem; padding: .5rem .65rem; white-space: nowrap; }
.es-navbar .nav-link:hover { background: var(--es-bg); }
.es-navbar .nav-link.active { color: var(--es-green-dark); background: #e9f0dd; font-weight: 600; }
.es-icon-btn { color: var(--es-green-dark); font-size: 1.25rem; text-decoration: none; padding: .375rem .5rem; }
.es-icon-btn:hover { color: var(--es-green); }

/* Page header used by our pages */
.es-page-head { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.es-page-head h1 { font-size: 1.5rem; margin: 0; color: var(--es-green-dark); font-weight: 700; }
.card { border-color: #e3e8da; border-radius: .75rem; }
.card-header { background: #fbfcf9; }

/* Phone bottom tab bar */
.es-tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 1030;
  display: flex; background: #fff; border-top: 1px solid #dfe5d4;
  padding-bottom: env(safe-area-inset-bottom);
}
.es-tabbar a {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: .45rem 0 .4rem; font-size: .7rem; color: #5b6455; text-decoration: none; min-height: 52px;
}
.es-tabbar a i { font-size: 1.15rem; }
.es-tabbar a.active { color: var(--es-green-dark); font-weight: 600; }
@media (max-width: 991.98px) {
  body.es-body { padding-bottom: calc(60px + env(safe-area-inset-bottom)); }
}

/* Rendered help/announcement/chat markdown */
.es-prose { line-height: 1.6; max-width: 72ch; }
.es-prose h2 { font-size: 1.25rem; margin-top: 1.5rem; color: var(--es-green-dark); }
.es-prose h3 { font-size: 1.05rem; margin-top: 1.25rem; }
.es-prose img { max-width: 100%; height: auto; border: 1px solid #e3e8da; border-radius: .5rem; }
.es-prose ol li, .es-prose ul li { margin-bottom: .35rem; }

/* Secret (alarm code) reveal */
.es-secret { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .05em; }

/* Tables on phones: let them scroll inside their card, never the page */
.table-responsive { -webkit-overflow-scrolling: touch; }

/* Status pills */
.es-pill { display: inline-block; padding: .15rem .55rem; border-radius: 999px; font-size: .75rem; font-weight: 600; }
.es-pill-commercial { background: #e3ecf7; color: #1f4a7a; }
.es-pill-residential { background: #f3ead9; color: #6b4a12; }
.es-pill-active { background: #e2f0d0; color: #33501a; }
.es-pill-muted { background: #ececec; color: #555; }

/* Tab bar badge */
.es-tabbar a { position: relative; }
.es-tab-badge { position: absolute; top: 4px; left: calc(50% + 6px); min-width: 18px; padding: 0 5px; border-radius: 9px;
  background: #b42318; color: #fff; font-size: .65rem; line-height: 18px; font-weight: 700; text-align: center; }

/* Chat */
.es-avatar { width: 40px; height: 40px; flex: none; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: #e8eedd; color: var(--es-green-dark); }
.es-chat-log { height: calc(100vh - 360px); min-height: 280px; overflow-y: auto; display: flex; flex-direction: column; gap: .5rem; padding: .75rem; }
@media (max-width: 991.98px) { .es-chat-log { height: calc(100vh - 380px); } }
.es-msg { max-width: 82%; align-self: flex-start; background: #fff; border: 1px solid #e1e6d8; border-radius: 14px 14px 14px 4px; padding: .45rem .7rem; }
.es-msg.es-mine { align-self: flex-end; background: #eef4e3; border-color: #d4e2bd; border-radius: 14px 14px 4px 14px; }
.es-msg.es-scheduled { border-style: dashed; background: #fffdf5; border-color: #c9b36b; margin-left: auto; }
.es-msg.es-deleted .es-msg-body { color: #6c757d; }
.es-msg-name { font-size: .75rem; font-weight: 600; color: var(--es-green-dark); }
.es-msg-body p:last-child, .es-msg-body ul:last-child, .es-msg-body ol:last-child { margin-bottom: 0; }
.es-msg-body { overflow-wrap: anywhere; }
.es-msg-meta { font-size: .7rem; color: #5b6455; margin-top: 2px; }
.es-msg-acts .btn-link { font-size: .7rem; }
.es-composer textarea { resize: vertical; min-height: 44px; }
.min-w-0 { min-width: 0; }

/* Forms */
.es-big-check { padding: .35rem 0 .35rem 2rem; border-bottom: 1px solid #eef0ea; }
.es-big-check .form-check-input { width: 1.4em; height: 1.4em; margin-left: -2rem; margin-top: .05em; }
.es-big-check .form-check-label { width: 100%; }
.es-choices .btn { min-width: 5.5rem; }
.es-q.es-has-err > label, .es-q.es-has-err legend { color: #b02a37; }
.es-q.es-has-err .form-control, .es-q.es-has-err .form-select, .es-q.es-has-err .es-sig { border-color: #b02a37; }
.es-sticky-actions { position: sticky; bottom: 0; background: var(--bs-body-bg, #fff); border-top: 1px solid #e1e6d8; z-index: 5; }
@media (max-width: 991.98px) { .es-sticky-actions { bottom: calc(60px + env(safe-area-inset-bottom)); } }   /* sits above the phone tab bar */
.es-field .card-header { background: #f6f8f2; }

/* ---------- help assistant ---------- */
.es-bot-fab { position: fixed; right: 16px; bottom: 16px; z-index: 1030; border-radius: 999px; background: var(--es-green); color: #fff;
  box-shadow: 0 4px 14px rgba(0,0,0,.2); padding: .6rem .9rem; font-weight: 600; }
.es-bot-fab:hover, .es-bot-fab:focus { background: var(--es-green-dark); color: #fff; }
@media (max-width: 991.98px) { .es-bot-fab { bottom: calc(72px + env(safe-area-inset-bottom)); width: 48px; height: 48px; padding: 0; } }
.es-bot-offcanvas { --bs-offcanvas-width: 420px; }
@media (max-width: 575.98px) { .es-bot-offcanvas { --bs-offcanvas-width: 100vw; } }
.es-bot { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
.es-bot-card .es-bot { height: min(70vh, 640px); }
.es-bot-log { flex: 1 1 auto; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: .6rem; }
.es-bot-msg { max-width: 92%; padding: .55rem .8rem; border-radius: .9rem; line-height: 1.45; overflow-wrap: anywhere; }
.es-bot-msg p:last-child, .es-bot-msg ol:last-child, .es-bot-msg ul:last-child { margin-bottom: 0; }
.es-bot-q { align-self: flex-end; background: var(--es-green); color: #fff; border-bottom-right-radius: .25rem; white-space: pre-wrap; }
.es-bot-a { align-self: flex-start; background: var(--bs-tertiary-bg); border-bottom-left-radius: .25rem; }
.es-bot-err { background: var(--bs-danger-bg-subtle); }
.es-bot-src { margin-top: .4rem; }
.es-bot-form { border-top: 1px solid var(--bs-border-color); padding: .75rem 1rem 1rem; }
@media (min-width: 992px) { body:has(#botFab) .es-footer .container-xl { padding-right: 120px !important; } }
