/* Identidad Grupo Ocean — Inter · #0047ab · botones píldora. Diseño: claude.ai/artifact/28GVnoze4SFc2fj5z9i6YU */
:root {
  --ocean-blue: #0047ab;
  --ocean-blue-dark: #003b8e;
  --ocean-blue-light: #4880c0;
  --ocean-navy: #181858;
  --ocean-link: #1c6dbf;
  --bg: #f5f7fb;
  --surface: #ffffff;
  --border: #e3e7ee;
  --chip-border: #d7e2f6;
  --text: #262626;
  --title: #0a0a0a;
  --muted: #5a6472;
  --tint: #eaf0fb;
  --error-bg: #fdecea;
  --error-border: #f5c2c0;
  --error: #b3261e;
  --radius-bubble: 16px;
  --radius-pill: 25px;
  --font: "Inter", Helvetica, Arial, Verdana, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { font-family: var(--font); font-size: 15px; line-height: 1.55; background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.app { display: flex; height: 100%; background: var(--bg); position: relative; }
.chat { display: flex; flex-direction: column; flex: 1; min-width: 0; height: 100%; }

/* ---------- panel de favoritos ---------- */
.panel { width: 300px; flex-shrink: 0; display: flex; flex-direction: column; background: var(--surface); border-right: 1px solid var(--border); height: 100%; }
.panel.hidden { display: none; }
.panel-head { display: flex; align-items: center; justify-content: space-between; padding: 0 14px 0 20px; height: 68px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.panel-title { font-weight: 600; font-size: 15px; color: var(--title); }
.panel-empty { padding: 20px; font-size: 13px; color: var(--muted); line-height: 1.5; }
.panel-empty.hidden { display: none; }
.fav-list { list-style: none; margin: 0; padding: 8px; overflow-y: auto; flex: 1; }
.fav-item { display: flex; align-items: stretch; border-radius: 10px; }
.fav-item:hover { background: var(--bg); }
.fav-item.current { background: var(--tint); }
.fav-open { flex: 1; min-width: 0; text-align: left; background: none; border: none; padding: 10px 12px; cursor: pointer; font-family: var(--font); display: flex; flex-direction: column; gap: 3px; }
.fav-title { font-size: 14px; font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fav-meta { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fav-actions { display: flex; align-items: center; gap: 2px; padding-right: 6px; opacity: 0; transition: opacity .15s; }
.fav-item:hover .fav-actions, .fav-item.current .fav-actions { opacity: 1; }
.fav-actions button { width: 30px; height: 30px; border-radius: 50%; border: none; background: transparent; color: var(--muted); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.fav-actions button:hover { background: var(--surface); color: var(--ocean-blue); }
.fav-delete:hover { color: var(--error) !important; }
.fav-error { padding: 12px; font-size: 13px; color: var(--error); }
.fav-item { flex-wrap: wrap; }
.fav-item.editing, .fav-item.confirming { background: var(--tint); }
.fav-item.editing .fav-actions, .fav-item.confirming .fav-actions { opacity: 1; }
.fav-rename-input { width: 100%; box-sizing: border-box; font: inherit; font-size: 14px; font-weight: 500; color: var(--text); border: 1px solid var(--ocean-blue); border-radius: 6px; padding: 4px 8px; outline: none; background: #fff; box-shadow: 0 0 0 3px rgba(0,71,171,.12); }
.fav-confirm { flex-basis: 100%; display: flex; align-items: center; gap: 8px; padding: 6px 12px 10px; font-size: 13px; color: var(--text); }
.fav-confirm span { flex: 1; }
.fav-confirm button { font-family: var(--font); font-size: 12px; font-weight: 500; padding: 6px 12px; border-radius: var(--radius-pill); cursor: pointer; }
.fav-confirm-yes { background: var(--error); border: 1px solid var(--error); color: #fff; }
.fav-confirm-no { background: #fff; border: 1px solid var(--border); color: var(--text); }
.panel-foot { padding: 12px 20px; font-size: 11px; color: var(--muted); border-top: 1px solid var(--border); }
.panel-backdrop { display: none; }
.btn-icon-sm { width: 32px; height: 32px; }
.btn-fav.active { color: #d99a00; border-color: #f2cf6d; background: #fff7dc; }
.btn-fav.active svg { fill: #f5b301; stroke: #d99a00; }

/* ---------- cabecera ---------- */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 32px; height: 68px; background: var(--surface); border-bottom: 1px solid var(--border); flex-shrink: 0; }
.brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.brand-logo { height: 34px; width: auto; display: block; }
.brand-mark { display: none; width: 30px; height: 30px; }
.brand-text { border-left: 1px solid var(--border); padding-left: 18px; }
.brand-name { font-weight: 600; font-size: 15px; color: var(--title); line-height: 1.2; }
.brand-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.badge { font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--ocean-blue); background: var(--tint); padding: 4px 10px; border-radius: var(--radius-pill); }
.topbar-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

/* ---------- botones ---------- */
.btn-ghost, .btn-primary { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font); font-weight: 500; font-size: 14px; line-height: 16px; padding: 10px 16px; border-radius: var(--radius-pill); cursor: pointer; transition: background .15s, color .15s, border-color .15s; }
.btn-ghost { background: transparent; border: 1px solid var(--ocean-blue); color: var(--ocean-blue); }
.btn-ghost:hover { background: var(--ocean-blue); color: #fff; }
.btn-ghost.btn-neutral { border-color: var(--border); color: var(--text); }
.btn-ghost.btn-neutral:hover { background: var(--bg); color: var(--text); }
.btn-primary { background: var(--ocean-blue); border: 1px solid var(--ocean-blue); color: #fff; padding: 12px 22px; }
.btn-primary:hover { background: var(--ocean-blue-dark); border-color: var(--ocean-blue-dark); }
.btn-icon { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); color: var(--muted); cursor: pointer; }
.btn-icon:hover { border-color: var(--ocean-blue); color: var(--ocean-blue); }

/* ---------- mensajes ---------- */
.messages { flex: 1; overflow-y: auto; padding: 28px 32px 8px; display: flex; flex-direction: column; align-items: center; }
.messages > .msg { width: 100%; max-width: 820px; }
.msg { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 18px; }
.msg-user { justify-content: flex-end; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--surface); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.avatar img { width: 22px; height: 22px; display: block; }
.msg-body { display: flex; flex-direction: column; gap: 8px; max-width: 640px; min-width: 0; }
.bubble { padding: 14px 18px; border-radius: var(--radius-bubble); font-size: 15px; line-height: 1.55; white-space: pre-wrap; word-wrap: break-word; }
.msg-bot .bubble { background: var(--surface); border: 1px solid var(--border); border-bottom-left-radius: 4px; box-shadow: 0 1px 2px rgba(24,24,88,.04); }
.msg-user .bubble { max-width: 560px; background: var(--ocean-blue); color: #fff; border-bottom-right-radius: 4px; }
.msg-error .bubble { background: var(--error-bg); border: 1px solid var(--error-border); color: var(--error); }
.bubble ul, .bubble ol { margin: 6px 0; padding-left: 22px; white-space: normal; }
.bubble li { margin: 3px 0; }
.bubble strong { font-weight: 600; }
.bubble a { color: var(--ocean-link); text-decoration: underline; word-break: break-all; }
.msg-user .bubble a { color: #fff; }
.bubble code { background: var(--tint); color: var(--ocean-navy); padding: 1px 6px; border-radius: 3px; font-size: 13px; }

.tag-urgent { display: inline-flex; align-items: center; gap: 8px; align-self: flex-start; font-size: 16px; font-weight: 600; color: var(--error); background: var(--error-bg); border: 1px solid var(--error-border); padding: 6px 14px; border-radius: var(--radius-pill); margin-bottom: 10px; white-space: normal; }
.source { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; font-size: 12px; color: var(--muted); background: var(--tint); padding: 5px 10px; border-radius: 6px; }

.notice { display: flex; gap: 14px; align-items: flex-start; max-width: 640px; padding: 14px 16px; border-radius: var(--radius-bubble); border-bottom-left-radius: 4px; }
.notice-mail { background: #eef8f1; border: 1px solid #bfe3c8; color: #14532d; }
.notice-icon { width: 38px; height: 38px; border-radius: 50%; background: #d3efdb; color: #15803d; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.notice-title { display: flex; align-items: center; gap: 6px; font-weight: 600; font-size: 14px; color: #14532d; }
.notice-title svg { color: #15803d; }
.notice-sub { font-size: 13px; color: #3f6b4a; margin-top: 4px; line-height: 1.45; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { font-family: var(--font); font-size: 13px; font-weight: 500; padding: 8px 14px; border-radius: var(--radius-pill); border: 1px solid var(--chip-border); background: var(--surface); color: var(--ocean-blue); cursor: pointer; transition: background .15s, color .15s; }
.chip:hover { background: var(--ocean-blue); color: #fff; border-color: var(--ocean-blue); }

.typing .bubble { display: inline-flex; gap: 5px; padding: 15px 18px; }
.typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--ocean-blue-light); animation: blink 1.2s infinite ease-in-out; }
.typing span:nth-child(2) { animation-delay: .2s; }
.typing span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }

/* ---------- composer ---------- */
.composer { flex-shrink: 0; display: flex; flex-direction: column; align-items: center; padding: 8px 32px 14px; background: var(--bg); }
#form, .hint { width: 100%; max-width: 820px; }
#form { display: flex; gap: 10px; align-items: flex-end; }
.input-wrap { flex: 1; min-width: 0; border: 1px solid var(--border); border-radius: 24px; background: var(--surface); box-shadow: 0 1px 3px rgba(24,24,88,.06); overflow: hidden; padding: 4px 6px 4px 0; transition: border-color .15s, box-shadow .15s; }
.input-wrap:focus-within { border-color: var(--ocean-blue); box-shadow: 0 0 0 3px rgba(0,71,171,.12); }
#input { display: block; width: 100%; resize: none; overflow-y: hidden; scrollbar-width: thin; scrollbar-color: var(--chip-border) transparent; border: none; border-radius: 0; padding: 10px 14px 10px 20px; font: inherit; font-size: 15px; line-height: 1.4; max-height: 160px; outline: none; background: transparent; color: var(--text); }
#input::-webkit-scrollbar { width: 6px; }
#input::-webkit-scrollbar-thumb { background: var(--chip-border); border-radius: 3px; }
#btn-send { width: 48px; height: 48px; border-radius: 50%; border: none; background: var(--ocean-blue); color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: background .15s; }
#btn-send:hover { background: var(--ocean-blue-dark); }
#btn-send:disabled { opacity: .5; cursor: default; }
#btn-mic { width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); color: var(--ocean-blue); cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: background .15s, color .15s, border-color .15s; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
#btn-mic:hover { border-color: var(--ocean-blue); }
#btn-mic.recording { background: var(--error); border-color: var(--error); color: #fff; animation: pulse 1s infinite; }
#btn-mic.hidden { display: none; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(179,38,30,.35); } 50% { box-shadow: 0 0 0 8px rgba(179,38,30,0); } }
.msg-user .bubble.audio { display: inline-flex; align-items: center; gap: 8px; font-style: italic; opacity: .85; }
.msg-user .bubble.audio svg { flex-shrink: 0; }
.hint { display: flex; justify-content: space-between; gap: 12px; font-size: 11px; color: var(--muted); margin-top: 8px; padding: 0 6px; }

/* ---------- correo propuesto (borrador a revisar) ---------- */
.msg-body.has-draft { flex: 1 1 auto; width: 100%; }
.draft { max-width: 640px; width: 100%; box-sizing: border-box; border: 1px solid #c7d7f0; background: #f4f8fe; border-radius: var(--radius-bubble); border-bottom-left-radius: 4px; padding: 14px 16px; }
.draft-head { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; color: var(--ocean-blue); margin-bottom: 10px; }
.draft-head svg { color: var(--ocean-blue); }
.draft-row { display: flex; gap: 8px; font-size: 13px; margin: 4px 0; color: var(--text); }
.draft-row .k { color: var(--muted); min-width: 56px; }
.draft-row .v.muted { color: var(--muted); font-style: italic; }
.draft textarea { display: block; box-sizing: border-box; width: 100%; margin-top: 8px; min-height: 72px; overflow: hidden; resize: none; font: inherit; font-size: 14px; line-height: 1.45; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: #fff; color: var(--text); }
.draft textarea:focus { outline: none; border-color: var(--ocean-blue); box-shadow: 0 0 0 3px rgba(0,71,171,.12); }
.draft-hint { font-size: 12px; color: var(--muted); margin-top: 6px; }
.draft-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; align-items: center; }
.draft-actions button { font-family: var(--font); font-size: 13px; font-weight: 500; padding: 8px 16px; border-radius: var(--radius-pill); cursor: pointer; border: 1px solid var(--border); background: #fff; color: var(--text); }
.draft-actions .draft-send { background: var(--ocean-blue); border-color: var(--ocean-blue); color: #fff; }
.draft-actions .draft-send:hover { background: var(--ocean-blue-dark, #003a8c); }
.draft-actions button:disabled { opacity: .55; cursor: default; }
.draft-status { font-size: 12px; color: var(--muted); }
.draft-error { font-size: 12px; color: var(--error); }
.draft.done { opacity: .78; }
.draft.done textarea { background: #f7f7f7; color: #555; }
.draft-badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: #e3e9f3; color: #3b4a63; margin-left: auto; }
.draft.sent .draft-badge { background: #d3efdb; color: #15803d; }

/* ---------- acceso con Microsoft ---------- */
.login { position: fixed; inset: 0; background: var(--bg); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 30; }
.login.hidden { display: none; }
.login-card { background: #fff; border: 1px solid var(--border); border-radius: 16px; padding: 40px 36px; width: 100%; max-width: 420px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 14px; box-shadow: 0 20px 50px rgba(24,24,88,.12); }
.login-logo { height: 36px; margin-bottom: 8px; }
.login-card h2 { margin: 0; font-size: 22px; font-weight: 600; color: var(--title); }
.login-card p { margin: 0; font-size: 14px; color: var(--muted); }
.btn-ms { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font); font-size: 15px; font-weight: 500; padding: 12px 22px; border-radius: var(--radius-pill); border: 1px solid var(--border); background: #fff; color: var(--text); cursor: pointer; margin-top: 8px; transition: background .15s, border-color .15s; }
.btn-ms:hover { border-color: var(--ocean-blue); background: var(--tint); }
.login-error { font-size: 13px; color: var(--error); background: var(--error-bg); border: 1px solid var(--error-border); border-radius: 8px; padding: 8px 12px; }
.login-error.hidden { display: none; }
.login-foot { font-size: 11px; color: var(--muted); margin-top: 8px; }
.user-chip { display: flex; align-items: center; gap: 6px; padding-left: 10px; border-left: 1px solid var(--border); margin-left: 4px; }
.user-chip.hidden { display: none; }
.user-name { font-size: 13px; font-weight: 500; color: var(--text); max-width: 180px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#btn-token.hidden { display: none; }

/* ---------- modal ---------- */
.modal { position: fixed; inset: 0; background: rgba(24,24,88,.55); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 10; }
.modal.hidden { display: none; }
.modal-card { background: #fff; border-radius: 12px; padding: 32px; width: 100%; max-width: 440px; display: flex; flex-direction: column; gap: 18px; box-shadow: 0 20px 50px rgba(24,24,88,.25); }
.modal-head { display: flex; align-items: center; gap: 14px; }
.modal-icon { width: 48px; height: 48px; border-radius: 50%; background: var(--tint); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.modal-icon img { width: 28px; height: 28px; display: block; }
.modal-card h2 { margin: 0; font-size: 20px; font-weight: 600; color: var(--title); line-height: 1.2; }
.modal-sub { font-size: 13px; color: var(--muted); margin-top: 3px; }
.modal-card p { margin: 0; font-size: 14px; line-height: 1.55; color: var(--muted); }
.field-label { font-size: 13px; font-weight: 500; margin-bottom: -10px; }
.field { display: flex; align-items: center; gap: 10px; border: 1px solid var(--border); border-radius: 3px; padding: 0 14px; height: 46px; color: var(--muted); transition: border-color .15s, box-shadow .15s; }
.field:focus-within { border-color: var(--ocean-blue); box-shadow: 0 0 0 3px rgba(0,71,171,.12); }
.field input { flex: 1; min-width: 0; border: none; outline: none; font: inherit; font-size: 15px; color: var(--text); background: transparent; }
.field button { border: none; background: transparent; color: var(--muted); display: flex; cursor: pointer; padding: 4px; }
.field-help { font-size: 12px; color: var(--muted); margin-top: -10px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 4px; }

/* ---------- móvil ---------- */
@media (max-width: 900px) {
  .panel { position: absolute; left: 0; top: 0; bottom: 0; z-index: 20; width: min(320px, 86vw); box-shadow: 0 0 40px rgba(24,24,88,.25); }
  .panel-backdrop { display: block; position: absolute; inset: 0; background: rgba(24,24,88,.35); z-index: 15; }
  .panel-backdrop.hidden { display: none; }
}
@media (max-width: 640px) {
  .topbar { padding: 0 14px; height: 60px; }
  .brand { gap: 10px; }
  .brand-logo { display: none; }
  .brand-mark { display: block; }
  .brand-text { border: none; padding: 0; }
  .brand-name { font-size: 14px; }
  .brand-sub { display: none; }
  .badge { display: none; }
  .btn-ghost span { display: none; }
  .user-name { display: none; }
  .btn-ghost { width: 40px; height: 40px; padding: 0; justify-content: center; border-radius: 50%; }
  .messages { padding: 18px 14px 6px; }
  .msg { gap: 8px; margin-bottom: 14px; }
  .avatar { display: none; }
  .msg-body { max-width: 88%; }
  .msg-user .bubble { max-width: 300px; }
  .bubble { padding: 12px 15px; }
  .composer { padding: 10px 12px 14px; background: var(--surface); border-top: 1px solid var(--border); }
  .input-wrap { background: var(--bg); box-shadow: none; }
  #input { font-size: 16px; }
  #btn-send, #btn-mic { width: 46px; height: 46px; }
  .hint { display: none; }
  .modal-card { padding: 24px; }
}
