/* A'AMER service desk — shared shell.
 *
 * Values are taken from the live Archibus install rather than eyeballed: navy
 * #002B5C at 220px, the emerald #16a34a accent, and the "Open Sans" / Verdana
 * stack the real system uses. Keeping them identical is the point — these
 * pages sit beside that dashboard and should not look like a different product.
 */

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: "Open Sans", Verdana, Arial, Helvetica, sans-serif;
    color: #1f2933;
    background: #f4f6f8;
}

.app { display: flex; min-height: 100vh; }

/* ── sidebar ──────────────────────────────────────────────────────────────── */
.sidebar { width: 220px; background: #002b5c; color: #fff; flex-shrink: 0; }

.brand {
    display: flex; align-items: center; gap: 10px;
    padding: 20px 18px; font-weight: 700; color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    text-decoration: none;
}
.brand-mark { width: 32px; height: 32px; display: block; }
.brand-name { font-size: 17px; letter-spacing: 0.5px; }

.nav { display: flex; flex-direction: column; padding: 10px 0; }

/* The three doors. Emerald-tinted so they read as the AI entries rather than
   as more of the dashboard's own navigation. */
.nav-ai {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 18px;
    font-size: 13px; font-weight: 600;
    color: #bbf7d0; text-decoration: none;
    border-left: 3px solid transparent;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.nav-ai:hover { background: rgba(22, 163, 74, 0.25); color: #fff; }
.nav-ai.active {
    background: #16a34a; color: #fff; border-left-color: #bbf7d0;
}
.nav-ai .ico { font-size: 15px; line-height: 1; }

/* ── main ─────────────────────────────────────────────────────────────────── */
.main { flex: 1; padding: 24px 32px; min-width: 0; display: flex; flex-direction: column; }

.page-head {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 18px; gap: 16px;
}
.page-title { display: flex; align-items: center; gap: 12px; }
.page-icon { font-size: 24px; }
.page-title h1 { margin: 0; font-size: 24px; color: #0b2545; }
.back { font-size: 14px; color: #2563eb; text-decoration: none; }
.back:hover { text-decoration: underline; }

.card {
    background: #fff; border: 1px solid #e3e8ee; border-radius: 10px;
    padding: 18px 20px;
}
.lede { margin: 0 0 14px; font-size: 14px; color: #3e4c59; line-height: 1.5; }

/* ── buttons ──────────────────────────────────────────────────────────────── */
.btn-primary {
    display: inline-flex; align-items: center; gap: 8px;
    background: #16a34a; color: #fff; border: none; border-radius: 7px;
    padding: 10px 18px; font-family: inherit; font-size: 14px; font-weight: 600;
    cursor: pointer;
}
.btn-primary:hover { background: #15803d; }
.btn-primary:disabled { opacity: 0.7; cursor: progress; }

.btn-secondary {
    background: #fff; color: #3e4c59; border: 1px solid #cbd2da; border-radius: 7px;
    padding: 8px 14px; font-family: inherit; font-size: 13px; cursor: pointer;
}
.btn-secondary:hover { background: #f1f4f8; }

/* ── conversation ─────────────────────────────────────────────────────────── */
.chat-log {
    flex: 1; min-height: 320px; overflow-y: auto;
    display: flex; flex-direction: column; gap: 8px; padding: 6px 2px;
}
.msg {
    max-width: 80%; padding: 9px 13px; border-radius: 14px;
    font-size: 14px; line-height: 1.45; white-space: pre-wrap; word-wrap: break-word;
}
.msg.agent { align-self: flex-start; background: #eef1f5; color: #1f2933;
             border-bottom-left-radius: 4px; }
.msg.user  { align-self: flex-end;   background: #16a34a; color: #fff;
             border-bottom-right-radius: 4px; }
.msg.error { align-self: flex-start; background: #fee2e2; color: #b91c1c;
             border: 1px solid #fca5a5; }

.typing { align-self: flex-start; background: #eef1f5; border-radius: 14px;
          padding: 11px 14px; display: flex; gap: 5px; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: #8a96a3;
            animation: bounce 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; }
.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes bounce { 0%,60%,100% { opacity: .35; transform: translateY(0); }
                    30% { opacity: 1; transform: translateY(-3px); } }

/* ── tappable choices ─────────────────────────────────────────────────────── */
.chips { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.chips-prompt { font-size: 12px; color: #8a96a3; }
.chips-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
    padding: 7px 13px; border: 1px solid #cfd8e3; border-radius: 999px;
    background: #fff; color: #2563eb; font-family: inherit; font-size: 13px;
    font-weight: 600; cursor: pointer;
    /* Building names run long and must stay readable rather than stretching
       the row off screen. */
    max-width: 100%; text-align: left; line-height: 1.35;
}
.chip:hover:not(:disabled) { background: #f0f6ff; border-color: #2563eb; }
.chip:disabled { opacity: .5; cursor: not-allowed; }

/* ── what was filed ───────────────────────────────────────────────────────── */
.receipt {
    align-self: stretch; margin-top: 2px;
    background: #dcfce7; border: 1px solid #86efac; border-radius: 8px;
    padding: 10px 14px; font-size: 13px; color: #166534;
    display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
}
.receipt .sr { font-weight: 700; }
.receipt .lbl { color: #3f7a55; }
.receipt .ext { margin-left: auto; background: #16a34a; color: #fff; border-radius: 5px;
                padding: 3px 9px; font-size: 12px; text-decoration: none; }
.receipt a.ext:hover { background: #15803d; }
.receipt.warn { background: #fef3c7; border-color: #fcd34d; color: #92400e; }
.receipt.warn .lbl { color: #a16207; }
.receipt.crit { background: #fee2e2; border-color: #fca5a5; color: #b91c1c; }

/* Fixed emergency guidance. Not model output — see SAFETY_NOTICE. */
.safety {
    align-self: stretch; background: #fee2e2; border: 2px solid #ef4444;
    border-radius: 10px; padding: 11px 14px; font-size: 13.5px; line-height: 1.5;
    color: #991b1b; font-weight: 700; display: flex; gap: 9px; align-items: flex-start;
}

/* ── composer ─────────────────────────────────────────────────────────────── */
.composer { border-top: 1px solid #e3e8ee; padding-top: 12px; margin-top: 12px; }
.composer .row { display: flex; gap: 10px; align-items: flex-end; }
.composer textarea {
    flex: 1; resize: none; min-height: 44px; max-height: 140px; padding: 11px 13px;
    background: #fff; color: #1f2933; border: 1px solid #16a34a; border-radius: 7px;
    font-family: inherit; font-size: 14px; line-height: 1.5; outline: none;
}
.composer textarea:focus { border-color: #15803d; box-shadow: 0 0 0 3px rgba(22,163,74,.12); }
.hint { font-size: 12px; color: #8a96a3; margin-top: 8px; }

/* Hold-to-talk. */
.btn-talk {
    display: inline-flex; align-items: center; gap: 8px;
    background: #eef1f5; color: #0b2545; border: 1px solid #cbd2da; border-radius: 7px;
    padding: 10px 18px; font-family: inherit; font-size: 14px; font-weight: 600;
    cursor: pointer; user-select: none; -webkit-user-select: none; touch-action: none;
}
.btn-talk:hover:not(:disabled) { background: #e4e9ef; }
.btn-talk:disabled { opacity: .6; cursor: not-allowed; }
.btn-talk.rec { background: #16a34a; color: #fff; border-color: #16a34a; }
.mic-status { font-size: 12px; color: #8a96a3; margin-top: 8px; }
.mic-status.live { color: #16a34a; font-weight: 600; }
.mic-status.err  { color: #dc2626; font-weight: 600; }
