:root { color-scheme: light; font-family: "Segoe UI", system-ui, sans-serif; color: #29243d; background: #f6f5fa; }
* { box-sizing: border-box; }
body { margin: 0; }
button, input { font: inherit; }
a { color: #5b45b8; }
button, a, input { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #8566d6; outline-offset: 4px; }
h1:focus { outline: none; }
.mud-typography, .mud-input, .mud-button-root { font-family: "Segoe UI", system-ui, sans-serif; }
.mud-button-root { text-transform: none; min-height: 44px; letter-spacing: 0; font-weight: 600; }
.mud-input-adornment button { min-width: 44px; min-height: 44px; }
.app-shell { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.app-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: max(20px, env(safe-area-inset-top)) max(32px, env(safe-area-inset-right)) 20px max(32px, env(safe-area-inset-left)); border-bottom: 1px solid #e9e5f1; background: #fff; }
.brand { display: inline-flex; align-items: center; gap: 12px; color: #29243d; text-decoration: none; font-weight: 700; font-size: 23px; letter-spacing: -.8px; }
.brand-accent { color: #5b45b8; }
.header-caption { font-size: 13px; color: #686278; }
.main-content { flex: 1; width: 100%; display: grid; align-items: center; padding: 52px 28px; }
.login-layout { width: 100%; max-width: 420px; margin: auto; }
.eyebrow { display: block; font-size: 11px; font-weight: 700; letter-spacing: 2.5px; color: #5b45b8; margin-bottom: 22px; }
.login-card { padding: 32px; border: 1px solid #e6e1f0; border-radius: 20px; box-shadow: 0 16px 48px #49347a0a; }
.app-logo { display: block; width: 96px; height: 96px; object-fit: contain; margin-bottom: 16px; }
.login-card h1, .home-card h2 { font-size: 25px; font-weight: 650; letter-spacing: -.6px; margin: 0 0 6px; }
.card-description { color: #686278; font-size: 14px; margin: 0 0 20px; }
.login-submit { margin-top: 24px; min-height: 50px; box-shadow: none; }
.login-connection { display: flex; gap: 8px; justify-content: center; align-items: center; margin: 24px 0; font-size: 12px; color: #686278; overflow-wrap: anywhere; }
.connection-dot { width: 6px; height: 6px; flex-shrink: 0; border-radius: 50%; background: #a59abd; }
.login-tools { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 14px; border-top: 1px solid #ece8f3; }
.version-label { font-size: 12px; color: #686278; white-space: nowrap; }
.configuration-help { color: #686278; font-size: 14px; line-height: 1.6; }
.validation-errors { color: #b3261e; font-size: 13px; padding-left: 20px; margin-top: 12px; }
.app-footer { display: flex; justify-content: space-between; gap: 20px; padding: 20px max(32px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(32px, env(safe-area-inset-left)); color: #686278; font-size: 12px; }
.home-content { width: 100%; max-width: 900px; margin: auto; }
.home-content h1, .page-heading { font-size: 32px; font-weight: 650; margin-bottom: 24px; }
.home-card { border: 1px solid #e6e1f0; padding: 32px; border-radius: 20px; }
.home-card p { color: #686278; max-width: 520px; margin: 16px 0; line-height: 1.7; }
.update-notice { position: fixed; z-index: 1400; bottom: max(16px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); width: calc(100% - 32px); max-width: 580px; padding: 16px 20px; border-radius: 16px; background: #35265e; color: #fff; box-shadow: 0 8px 32px #35265e33; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.update-notice strong { display: block; font-size: 14px; }
.update-notice p { font-size: 12px; margin: 4px 0 0; color: #e5def5; }
.update-notice button { background: #ece6fb; color: #35265e; flex-shrink: 0; }
.boot-screen { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 18px; color: #686278; }
.boot-screen strong { font-size: 24px; color: #29243d; }
.boot-screen progress { width: 150px; accent-color: #5b45b8; }
#blazor-error-ui { display: none; position: fixed; z-index: 2000; bottom: 0; width: 100%; padding: 18px 48px 18px 20px; background: #fff0ce; color: #493600; box-shadow: 0 -2px 12px #0002; }
#blazor-error-ui .reload { margin-left: 12px; }
#blazor-error-ui .dismiss { position: absolute; right: 8px; top: 4px; background: none; border: none; padding: 12px; font-size: 22px; cursor: pointer; }
@media (max-width: 800px) {
    .main-content { padding: 32px 20px; }
    .header-caption { display: none; }
    .app-header { padding-left: max(20px, env(safe-area-inset-left)); padding-right: max(20px, env(safe-area-inset-right)); }
}
@media (max-width: 420px) {
    .main-content { padding: 24px 16px; }
    .login-card { padding: 24px 20px; }
    .app-footer { padding-left: 20px; padding-right: 20px; }
    .login-tools { flex-wrap: wrap; }
    .update-notice { align-items: flex-start; flex-direction: column; gap: 8px; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}


.main-content:focus { outline: none; }
.home-content { max-width: 620px; }
.home-card h1 { font-size: 28px; margin: 0 0 12px; }
.home-card p:last-child { margin-bottom: 0; }
@media (max-width: 600px) {
    .main-content:has(.login-layout) { padding-top: 12px; padding-bottom: 12px; }
    .login-layout .login-connection { margin: 16px 0; }
    .login-layout .login-submit { margin-top: 16px; }
    .app-shell:has(.login-layout) .app-footer { padding-top: 12px; padding-bottom: max(12px, env(safe-area-inset-bottom)); }
    .home-card { padding: 24px 20px; }
}

/* Same PIN access as SofyAutomocion, using each application's theme. */
.login-mode-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 5px; border-radius: 10px; background: var(--mud-palette-background); }
.login-mode-button { min-height: 44px; border: 0; border-radius: 7px; background: transparent; color: var(--mud-palette-text-secondary); font-weight: 600; cursor: pointer; }
.login-mode-button.is-active { background: #fff; color: var(--mud-palette-primary); box-shadow: 0 1px 5px #0001; }
.login-mode-button:disabled { cursor: default; opacity: .6; }
.login-pin-field input { text-align: center; font-size: 20px; letter-spacing: 4px; }
.pin-keypad { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.pin-key.mud-button-root { min-width: 0; min-height: 48px; font-size: 20px; border-radius: 8px; }
.pin-key-action.mud-button-root { font-size: 14px; }
.pin-mode .app-logo { width: 56px; height: 56px; margin-bottom: 12px; }
.pin-mode .login-card { padding-top: 24px; padding-bottom: 24px; }
.pin-mode .card-description { margin-bottom: 16px; }
.pin-mode .login-connection { margin: 16px 0; }
.pin-mode .login-submit { margin-top: 16px; }


/* Consultas de clientes: misma identidad de SofyIA, con controles para uso móvil. */
.main-content:has(.customer-workspace) { align-items: start; padding: 36px 24px 12px; }
.customer-workspace { width: 100%; max-width: 920px; margin: 0 auto; min-width: 0; }
.customer-workspace, .customer-workspace button, .customer-workspace input { font-family: "Segoe UI", system-ui, sans-serif; }
.query-intro { margin-bottom: 24px; }
.query-company { display: inline-flex; gap: 7px; align-items: center; font-size: 12px; color: #686278; margin-bottom: 14px; overflow-wrap: anywhere; }
.query-company .connection-dot { background: #8d79cb; }
.query-intro h1 { font-size: clamp(27px, 4vw, 36px); letter-spacing: -1.1px; line-height: 1.2; margin: 0 0 9px; font-weight: 700; }
.query-intro p { color: #686278; margin: 0; font-size: 15px; }
.query-panel { background: #fff; border: 1px solid #e4dfee; border-radius: 18px; padding: 20px; box-shadow: 0 8px 28px #49347a06; }
.query-panel label { display: block; color: #514962; font-size: 12px; font-weight: 600; margin-bottom: 10px; }
.query-input-row { display: flex; gap: 10px; align-items: center; padding: 5px 5px 5px 13px; background: #f8f7fb; border: 1px solid #dcd5ea; border-radius: 12px; }
.query-input-row:focus-within { border-color: #7859c4; box-shadow: 0 0 0 3px #7859c414; }
.query-input-row > .mud-icon-root { color: #8c80a6; flex-shrink: 0; }
.query-input-row input { min-width: 0; flex: 1; background: transparent; border: 0; outline: none; padding: 10px 0; min-height: 44px; color: #29243d; font-size: 15px; }
.query-input-row input::placeholder { color: #938b9e; }
.query-submit { background: #5b45b8; color: #fff; border: 0; border-radius: 9px; padding: 0 18px; min-height: 46px; font-size: 14px; font-weight: 600; cursor: pointer; }
.query-submit:disabled, .query-mic:disabled { opacity: .5; cursor: default; }
.query-caption { display: flex; align-items: center; gap: 6px; margin-top: 12px; font-size: 12px; color: #83798e; }
.query-caption .mud-icon-root { width: 17px; }
.query-alert { display: flex; gap: 10px; align-items: start; padding: 14px 16px; background: #fff2ef; border: 1px solid #f3d8d2; color: #8c352d; border-radius: 12px; margin-top: 18px; font-size: 14px; }
.query-alert .mud-icon-root { flex-shrink: 0; }
.query-alert p { margin: 0; line-height: 1.5; }
.query-notice { font-size: 13px; padding: 12px 0; margin: 0; color: #5b45b8; }
.query-understood { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 16px 0; font-size: 13px; color: #71677f; overflow-wrap: anywhere; }
.query-understood strong { color: #514962; font-weight: 500; }
.query-understood button, .customer-back { color: #5b45b8; background: transparent; border: 0; min-height: 44px; cursor: pointer; font-size: 13px; }
.query-understood button { padding: 0 10px; }
.query-empty { text-align: center; padding: 44px 20px; color: #686278; }
.query-empty h2 { font-size: 19px; color: #514962; margin: 18px 0 10px; font-weight: 600; letter-spacing: -.4px; }
.query-empty > p { font-size: 14px; max-width: 350px; margin: 0 auto; line-height: 1.7; }
.query-empty-icon { font-size: 42px; color: #a697c6; }
.query-welcome-icon { display: inline-flex; align-items: center; justify-content: center; width: 66px; height: 66px; background: #eae5f6; color: #7859c4; border-radius: 22px; transform: rotate(-5deg); }
.query-welcome-icon .mud-icon-root { font-size: 30px; transform: rotate(5deg); }
.query-examples { margin-top: 26px; font-size: 13px; }
.query-examples > span { display: block; color: #9a90a6; font-size: 11px; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 10px; }
.query-examples p { margin: 5px 0; }
.customer-results-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 22px 0 16px; }
.customer-results-title h2 { font-size: 17px; margin: 0; font-weight: 600; }
.customer-results-title > span { color: #8b8097; font-size: 12px; }
.customer-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 14px; }
.customer-card { display: flex; flex-direction: column; align-items: stretch; background: #fff; border: 1px solid #e4dfee; padding: 0; border-radius: 16px; text-align: left; color: #29243d; min-width: 0; overflow: hidden; overflow-wrap: anywhere; transition: border-color .15s, box-shadow .15s; }
.customer-card-open { display: flex; flex-direction: column; align-items: stretch; gap: 8px; padding: 19px 19px 10px; border: 0; background: transparent; text-align: left; color: inherit; width: 100%; cursor: pointer; }
.customer-card-open:focus-visible { outline: 2px solid #6650ad; outline-offset: -3px; border-radius: 14px; }
.customer-card-data { display: grid; gap: 4px; padding: 0 19px 16px; font-size: 12px; color: #80758e; }
.contact-data-row { display: flex; align-items: center; gap: 10px; min-width: 0; min-height: 44px; }
.contact-data-action, .contact-data-icon { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 44px; width: 44px; height: 44px; border-radius: 11px; }
.contact-data-action { color: #5b45b8; background: #f5f2fb; border: 1px solid #e2d9f0; text-decoration: none; }
.contact-data-action:hover { color: #4c359d; background: #ece5f8; border-color: #b7a4dc; }
.contact-data-action:focus-visible { outline: 2px solid #6650ad; outline-offset: 2px; }
.contact-data-action[aria-disabled=true] { opacity: .5; pointer-events: none; }
.contact-data-icon { color: #a498b3; }
.contact-data-row .mud-icon-root { font-size: 20px; }
.contact-data-value { min-width: 0; overflow-wrap: anywhere; line-height: 1.5; }
.customer-card-contacts { padding: 16px 19px 10px; border-top: 1px solid #eee8f5; background: #fcfbfe; }
.customer-card-contacts > h3, .customer-detail-contacts > h3 { font-size: 14px; margin: 0 0 14px; color: #635374; }
.person-contact { padding: 12px; margin-bottom: 12px; border: 1px solid #e9e2f1; border-radius: 12px; background: #fff; }
.person-contact.matched { border-color: #b8a5de; background: #faf7ff; }
.person-contact-heading { display: flex; gap: 7px; align-items: start; font-size: 14px; color: #40334f; }
.person-contact-heading .mud-icon-root { color: #8d79ae; flex-shrink: 0; }
.person-contact-match { display: inline-block; font-size: 11px; color: #654499; margin: 5px 0; }
.person-contact-position { font-size: 12px; color: #867890; margin: 5px 0 8px; }
.person-contact-data { display: grid; gap: 4px; font-size: 12px; color: #6f637d; margin: 6px 0 0; }
.person-contact-data:empty { display: none; }
.person-contact-empty { color: #8d809b; font-size: 13px; margin: 12px 0; }
.customer-contacts-more { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; min-height: 44px; border: 0; background: transparent; color: #654499; font-size: 13px; font-weight: 600; cursor: pointer; padding: 8px; }
.customer-detail-contacts { border-top: 1px solid #eee8f5; padding-top: 22px; }
.customer-card:hover { border-color: #a495cb; box-shadow: 0 5px 20px #5b45b80b; }
.customer-card-top { display: flex; gap: 10px; align-items: center; margin-bottom: 3px; width: 100%; }
.customer-card-top > .mud-icon-root { margin-left: auto; color: #9d90b6; }
.customer-avatar { display: inline-flex; align-items: center; justify-content: center; background: #eeebf7; color: #6650ad; width: 42px; height: 42px; flex-shrink: 0; border-radius: 13px; font-size: 13px; font-weight: 700; }
.customer-code { color: #8b8097; font-size: 11px; }
.customer-card-open > strong { font-size: 17px; line-height: 1.4; font-weight: 650; }
.customer-trade-name { color: #73687f; font-size: 13px; }
.query-more { display: block; padding: 10px 22px; min-height: 44px; border-radius: 10px; color: #5b45b8; border: 1px solid #d4cbe7; background: #fff; font-size: 13px; font-weight: 600; margin: 22px auto 0; cursor: pointer; }
.customer-warning { align-self: start; display: inline-block; font-size: 11px; color: #8f5c22; background: #fff1d9; border-radius: 5px; padding: 4px 7px; }
.customer-suggestion { align-self: start; color: #594188; background: #eee8f8; border-radius: 5px; padding: 4px 7px; font-size: 12px; }
.query-suggestion-description { color: #70657d; font-size: 14px; margin: -6px 0 16px; }
.query-suggestion-note { border: 1px solid #dfd4f0; background: #f5f0fc; border-radius: 12px; padding: 13px 16px; color: #594188; font-size: 14px; margin-top: 16px; }
.customer-detail { background: #fff; border: 1px solid #e4dfee; border-radius: 18px; padding: 20px 28px 14px; margin-top: 8px; }
.customer-back { display: inline-flex; align-items: center; gap: 7px; padding: 0; }
.customer-detail-heading { padding: 18px 0 24px; border-bottom: 1px solid #eeebf4; }
.customer-avatar.large { float: left; margin-right: 18px; width: 60px; height: 60px; border-radius: 18px; font-size: 18px; }
.customer-kicker { display: block; font-size: 10px; color: #8c7fa1; letter-spacing: 1.7px; padding-top: 3px; margin-bottom: 7px; }
.customer-detail-heading h2 { margin: 0 0 5px; font-size: 23px; line-height: 1.3; letter-spacing: -.6px; overflow-wrap: anywhere; }
.customer-detail-heading p { color: #756980; font-size: 13px; margin: 6px 0; overflow-wrap: anywhere; }
.customer-reference { clear: both; padding-top: 13px; }
.customer-fields { margin: 20px 0 0; }
.customer-fields > div { padding: 16px 0; border-top: 1px solid #eeebf4; }
.customer-fields dt { color: #9a8ea7; font-size: 11px; margin-bottom: 6px; }
.customer-fields dd { color: #514962; font-size: 14px; margin: 0; overflow-wrap: anywhere; }
.query-voice-dock { position: sticky; z-index: 20; bottom: max(12px, env(safe-area-inset-bottom)); width: fit-content; max-width: 100%; min-width: 290px; margin: 28px auto 0; padding: 11px 16px 14px; text-align: center; background: #ffffffed; border: 1px solid #e4dfee; border-radius: 20px; box-shadow: 0 8px 35px #38275215; backdrop-filter: blur(12px); }
.query-voice-state { font-size: 11px; color: #887a99; margin-bottom: 9px; }
.query-voice-dock.query-voice-compact { min-width: 0; margin-right: 0; padding: 8px; border-radius: 17px; }
.query-voice-compact .query-voice-state { display: none; }
.query-voice-compact .query-mic { min-height: 46px; padding: 0 15px; }
.query-voice-buttons { display: flex; align-items: center; justify-content: center; gap: 10px; }
.query-mic { display: inline-flex; align-items: center; justify-content: center; gap: 10px; border: 0; border-radius: 12px; padding: 0 25px; min-height: 50px; color: #fff; background: #5b45b8; font-size: 14px; font-weight: 600; cursor: pointer; }
.query-mic.recording { background: #ad3f5c; }
.query-cancel { background: transparent; border: 0; color: #71637f; min-height: 44px; padding: 0 5px; font-size: 13px; cursor: pointer; }
@media (max-width: 600px) {
    .main-content:has(.customer-workspace) { padding: 24px 16px 8px; }
    .query-intro { margin-bottom: 20px; }
    .query-company { margin-bottom: 10px; }
    .query-panel { padding: 16px; }
    .query-input-row { gap: 6px; padding-left: 9px; }
    .query-input-row input { font-size: 16px; }
    .query-submit { padding: 0 12px; font-size: 13px; }
    .query-empty { padding: 35px 15px; }
    .customer-grid { grid-template-columns: 1fr; }
    .customer-results-title { flex-wrap: wrap; gap: 6px; }
    .customer-detail { padding: 15px 20px 8px; }
    .customer-detail-heading h2 { font-size: 21px; }
    .customer-avatar.large { width: 49px; height: 49px; margin-right: 12px; border-radius: 14px; }
    .query-voice-dock { padding: 10px 12px 12px; min-width: 0; width: 100%; }
    .query-mic { padding: 0 18px; flex: 1; }
}
