/* Puteca: a quiet, professional look for accounting firms. */
:root { --brand: #1f3a5f; --brand-soft: #f3f5f8; --ink: #1d2330; }
body { background: var(--brand-soft); color: var(--ink); }
.topbar { background: #fff; border-bottom: 1px solid #e3e7ee; }
.topbar .navbar-brand { font-weight: 700; color: var(--brand); letter-spacing: .01em; }
.topbar .nav-link.active { color: var(--brand); font-weight: 600; }
.btn-primary { --bs-btn-bg: var(--brand); --bs-btn-border-color: var(--brand); --bs-btn-hover-bg: #162b47;
               --bs-btn-hover-border-color: #162b47; --bs-btn-active-bg: #10223a; }
.btn-outline-primary { --bs-btn-color: var(--brand); --bs-btn-border-color: var(--brand); --bs-btn-hover-bg: var(--brand);
                       --bs-btn-hover-border-color: var(--brand); }
a { color: var(--brand); }
.card { border-color: #e3e7ee; }
.list-group-item { border-color: #e3e7ee; }
.kick { font-size: 3rem; font-weight: 800; color: #c4cbd6; }
.text-pre { white-space: pre-line; }
.flex-none { flex: none; }
.client-checks { max-height: 26rem; overflow-y: auto; columns: 2 16rem; }
.client-checks .form-check { break-inside: avoid; }
footer.site { color: #8a93a3; font-size: .85rem; }
/* pirata-core/auth-jwt-mfa: the profile photo (templates/auth/_avatar.html). Copy into the app's CSS and ADAPT
   the colours of the initials to the brand. */
.avatar { width: 36px; height: 36px; border-radius: 50%; flex: none; display: inline-grid; place-items: center;
          overflow: hidden; vertical-align: middle; background: #1f3a5f; color: #fff; font-weight: 700;
          font-size: .9rem; letter-spacing: .02em; line-height: 1; user-select: none; }
img.avatar { object-fit: cover; background: #e9e6df; }
.avatar-sm { width: 28px; height: 28px; font-size: .72rem; }
.avatar-lg { width: 96px; height: 96px; font-size: 2.2rem; }
.avatar-pick { cursor: pointer; }

/* ---------- the conversation (look and gestures from cordiale/prototipo/chat.html) ---------- */
body.chat-page { height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
.chat-main { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.chat-main > .alert { margin: .5rem 1rem 0; }
.chat-app { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr; max-width: 1280px; width: 100%;
            margin: 0 auto; background: #fff; border-inline: 1px solid #e3e7ee; }
@media (min-width: 992px) { .chat-app.with-list { grid-template-columns: 300px 1fr; } }
.chat-list { display: none; flex-direction: column; min-height: 0; border-right: 1px solid #e3e7ee; }
@media (min-width: 992px) { .chat-list { display: flex; } }
.chat-rows { overflow-y: auto; flex: 1; }
.chat-row { display: flex; gap: 8px; align-items: center; padding: .6rem .9rem; border-bottom: 1px solid #f0f2f6;
            color: var(--ink); text-decoration: none; }
.chat-row:hover { background: #f6f8fb; }
.chat-row.current { background: #e8eef6; font-weight: 600; }
.chat-row .row-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; background: #f6f4ee; }
.chat-head { display: flex; gap: 8px; align-items: center; padding: .55rem .9rem; background: #fff;
             border-bottom: 1px solid #e3e7ee; }
.msgs { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; padding: 14px; }
.msgs .day { align-self: center; font-size: 12px; color: #6a6e78; background: #fff; padding: 3px 10px;
             border-radius: 8px; box-shadow: 0 1px 2px rgba(20,22,28,.08); margin: 6px 0; }
.msgs .empty { margin: auto; color: #6a6e78; text-align: center; max-width: 28rem; }
.m { max-width: min(82%, 640px); display: flex; flex-direction: column; gap: 4px; }
.m.me { align-self: flex-end; }
.m.them { align-self: flex-start; }
.m.sys { align-self: center; max-width: 90%; }
.m.sys .bubble { background: transparent; box-shadow: none; color: #6a6e78; font-size: 13px; text-align: center; padding: 0; }
.m.sys .stamp { display: none; }
.who { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--brand); }
.face { width: 32px; height: 32px; border-radius: 50%; flex: none; object-fit: cover; background: #e9e6df; }
.face.initials { display: inline-grid; place-items: center; background: var(--brand); color: #fff; font-weight: 700; font-size: 13px; }
.bubble { background: #fff; border-radius: 14px; padding: 8px 11px 5px; box-shadow: 0 1px 2px rgba(20,22,28,.08);
          line-height: 1.42; overflow-wrap: anywhere; }
.m.me .bubble { background: #dfeaf6; border-top-right-radius: 4px; }
.m.them .bubble { border-top-left-radius: 4px; }
.m.colleague .bubble { background: #eef1e8; }
.bubble .by { font-size: 12px; font-weight: 600; color: #5b6270; margin-bottom: 2px; }
.bubble .text { white-space: normal; }
.m.me .text, .m.colleague .text { white-space: pre-wrap; }
.bubble .text > :last-child { margin-bottom: 0; }
.bubble .text table { font-size: 13px; }
.bubble .text th, .bubble .text td { padding: 2px 6px; border-bottom: 1px solid #e3e7ee; }
.stamp { font-size: 11px; color: #6a6e78; text-align: right; }
.card-mini { background: #fff; border-radius: 14px; box-shadow: 0 1px 2px rgba(20,22,28,.08), 0 6px 20px rgba(20,22,28,.06);
             overflow: hidden; min-width: min(300px, 72vw); }
.card-mini .kind { padding: 10px 14px 0; font-size: 11px; letter-spacing: .07em; text-transform: uppercase; color: #6a6e78; }
.card-mini .title { padding: 2px 14px 0; font-weight: 700; font-size: 16px; line-height: 1.25; }
.card-mini .line { padding: 6px 14px 10px; }
.card-mini .open { display: block; width: 100%; border: 0; border-top: 1px solid #e3e7ee; background: transparent;
                   padding: 9px; font-weight: 600; color: var(--brand); }
.card-mini .open:hover { background: #f6f8fb; }
.pill { font-size: 12px; font-weight: 600; border-radius: 10px; padding: 2px 8px; }
.pill.ok { background: #e3f5ea; color: #1f8a5a; }
.pill.warn { background: #fff2dc; color: #9a5c00; }
.pill.bad { background: #fde8e6; color: #b3261e; }
.pill.muted { background: #eceef2; color: #5b6270; }
.working { padding: 4px 14px; }
.working .job { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: #5b6270; }
.working .face { width: 24px; height: 24px; font-size: 11px; }
.typing { display: inline-flex; gap: 3px; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: #8a93a3; animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; } .typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 60%, 100% { opacity: .25; } 30% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .typing i { animation: none; } }
.readonly { padding: 10px 14px; text-align: center; color: #6a6e78; font-size: 14px; background: #fff; border-top: 1px solid #e3e7ee; }
.composer { position: relative; display: flex; gap: 6px; align-items: flex-end; padding: 8px 10px;
            padding-bottom: max(8px, env(safe-area-inset-bottom, 0px)); background: #f6f4ee; }
.composer[hidden] { display: none; }
.composer textarea { flex: 1; min-width: 0; resize: none; border: 0; border-radius: 20px; padding: 10px 14px;
                     box-shadow: 0 1px 2px rgba(20,22,28,.1); font: inherit; outline: none; max-height: 160px; }
.composer textarea:focus-visible { box-shadow: 0 0 0 2px var(--brand); }
.composer .target { border: 0; background: #fff; border-radius: 16px; padding: 6px 10px; font-size: 13px; font-weight: 600;
                    color: var(--brand); box-shadow: 0 1px 2px rgba(20,22,28,.1); white-space: nowrap; align-self: center; }
.iconbtn { width: 40px; height: 40px; border-radius: 50%; border: 0; background: transparent; display: grid; place-items: center;
           font-size: 1.15rem; color: var(--brand); flex: none; }
.iconbtn:hover { background: rgba(31,58,95,.08); }
.send { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--brand); color: #fff; flex: none;
        display: grid; place-items: center; }
.send:disabled { opacity: .5; }
.menu { position: absolute; left: 10px; right: 10px; bottom: 100%; max-height: 50vh; overflow-y: auto; background: #fff;
        border-radius: 12px; box-shadow: 0 6px 24px rgba(20,22,28,.18); padding: 4px; z-index: 5; }
.menu .item { display: flex; gap: 10px; align-items: center; width: 100%; text-align: left; border: 0; background: transparent;
              border-radius: 8px; padding: 8px; }
.menu .item.active, .menu .item:hover { background: #eef3f9; }
.menu .item small { display: block; color: #6a6e78; }
.chat-notice { position: absolute; left: 50%; transform: translateX(-50%); top: 64px; z-index: 6; padding: 8px 14px;
               border-radius: 12px; box-shadow: 0 6px 20px rgba(20,22,28,.15); font-size: 14px; max-width: calc(100% - 32px); }
.chat-notice.bad { background: #fde8e6; color: #8c1d17; }
.chat-notice.ok { background: #e3f5ea; color: #17663f; }
.sheet-scrim { position: fixed; inset: 0; background: rgba(10,12,16,.45); display: flex; align-items: flex-end;
               justify-content: center; z-index: 1050; }
.sheet-scrim[hidden] { display: none; }
@media (min-width: 768px) { .sheet-scrim { align-items: center; } }
.sheet { background: #fff; width: min(820px, 100%); max-height: 90dvh; border-radius: 18px 18px 0 0; display: flex; flex-direction: column;
         padding-bottom: env(safe-area-inset-bottom, 0px); }
@media (min-width: 768px) { .sheet { border-radius: 18px; } }
.sheet-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid #e3e7ee; }
.sheet-body { overflow: auto; padding: 14px 16px; }
.card-html { line-height: 1.5; }
.card-html table { width: 100%; font-size: 13.5px; margin-bottom: 1rem; }
.card-html th, .card-html td { padding: 5px 8px; border-bottom: 1px solid #e3e7ee; }
.card-html th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: #6a6e78; background: #f6f8fb; }
.card-actions { position: sticky; bottom: -14px; background: #fff; border-top: 1px solid #e3e7ee; margin: 14px -16px -14px; padding: 12px 16px; }
.card-actions .btns { display: flex; gap: 8px; flex-wrap: wrap; }
.card-step:not(:empty) { margin-top: 12px; }
