.support-view { min-height: 100vh; overflow-y: auto; background: radial-gradient(circle at 80% 0%, hsla(158, 64%, 42%, .12), transparent 34rem), var(--surface-bg); }
.support-main { max-width: 760px; margin: 0 auto; padding: 3.5rem var(--spacing-xl) 5rem; }
.support-heading { margin-bottom: 2rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--surface-border); }
.support-eyebrow { color: var(--color-success); font-size: .7rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.support-heading h1 { margin-top: .45rem; font-size: clamp(2rem, 5vw, 3.2rem); line-height: 1.05; }
.support-heading p { margin-top: .8rem; color: var(--text-secondary); }
.support-form { display: grid; gap: 1.25rem; padding: 1.5rem; background: hsla(222, 20%, 12%, .8); border: 1px solid var(--surface-border); border-radius: var(--radius-md); }
.support-form label { display: grid; gap: .45rem; color: var(--text-secondary); font-size: .8125rem; font-weight: 600; }
.support-form input, .support-form select, .support-form textarea { width: 100%; padding: .7rem .8rem; color: var(--text-primary); background: var(--surface-2); border: 1px solid var(--surface-border); border-radius: var(--radius-sm); font: inherit; outline: none; resize: vertical; }
.support-form input:focus, .support-form select:focus, .support-form textarea:focus { border-color: var(--color-primary); box-shadow: 0 0 0 3px var(--color-primary-dim); }
.support-form__actions { display: flex; justify-content: flex-end; gap: .75rem; padding-top: .25rem; }
.support-form__status { min-height: 1.4rem; color: var(--text-secondary); font-size: .875rem; }
.support-form__status--success { color: var(--color-success); }
.support-form__status--error { color: var(--color-danger); }
.support-section, .support-form-section { margin-top: 2rem; }
.support-section__heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.support-section__heading h2 { font-size: 1.15rem; }
.ticket-list { display: grid; gap: .65rem; }
.ticket-card { display: grid; grid-template-columns: 4rem minmax(0, 1fr) auto auto; align-items: center; gap: .8rem; width: 100%; padding: 1rem; text-align: left; color: var(--text-primary); background: hsla(222, 20%, 12%, .8); border: 1px solid var(--surface-border); border-radius: var(--radius-md); transition: border-color var(--duration-fast), background var(--duration-fast), transform var(--duration-fast); }
.ticket-card:hover { background: var(--surface-2); border-color: var(--color-primary); transform: translateY(-1px); }
.ticket-card strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ticket-card__number, .ticket-card time { color: var(--text-muted); font-size: .75rem; }
.ticket-status { padding: .2rem .5rem; border-radius: var(--radius-full); font-size: .7rem; font-weight: 600; white-space: nowrap; background: var(--surface-3); color: var(--text-secondary); }
.ticket-status--abierto, .ticket-status--reabierto, .ticket-status--solucionando { background: hsla(38, 95%, 52%, .14); color: var(--color-warning); }
.ticket-status--cerrado, .ticket-status--closed { background: hsla(158, 64%, 42%, .14); color: var(--color-success); }
.support-empty, .support-loading { padding: 1.5rem 0; color: var(--text-secondary); }
.support-chat { position: fixed; right: 1.5rem; bottom: 1.5rem; z-index: 200; display: flex; flex-direction: column; width: min(460px, calc(100vw - 3rem)); max-height: calc(100dvh - 3rem); overflow: hidden; color: var(--text-primary); background: hsl(222, 20%, 13%); border: 1px solid hsl(222, 16%, 29%); border-radius: 1rem; box-shadow: 0 22px 60px hsla(0, 0%, 0%, .55), 0 0 0 1px hsla(158, 64%, 42%, .08); animation: chatPop .22s var(--ease-default) both; }
.support-chat[hidden] { display: none; }
.support-chat .support-section__heading { margin: 0; padding: 1rem 1.15rem; background: linear-gradient(120deg, hsl(222, 20%, 17%), hsl(222, 20%, 13%)); border-bottom: 1px solid var(--surface-border); }
.support-chat .support-section__heading h2 { font-size: .95rem; font-weight: 600; }
.support-chat .support-section__heading h2 { min-width: 0; overflow-wrap: anywhere; }
.support-chat .support-section__heading h2::after { display: block; margin-top: .15rem; content: 'Soporte responde en este hilo'; color: var(--text-muted); font-size: .7rem; font-weight: 400; }
.support-chat .support-section__heading h2::before { content: ''; display: inline-block; width: .45rem; height: .45rem; margin: 0 .45rem .08rem 0; border-radius: 50%; background: var(--color-primary); box-shadow: 0 0 0 .2rem var(--color-primary-dim); }
.chat-messages { display: grid; align-content: start; gap: .7rem; min-height: 5rem; max-height: min(23rem, 45dvh); overflow-y: auto; padding: 1rem; background: hsl(222, 20%, 10%); }
.chat-message { max-width: 85%; padding: .75rem .9rem; color: var(--text-primary); background: hsl(222, 18%, 18%); border: 1px solid hsl(222, 16%, 26%); border-radius: .25rem .85rem .85rem .85rem; box-shadow: 0 4px 12px hsla(0, 0%, 0%, .15); }
.chat-message--customer { justify-self: end; color: #fff; background: var(--color-primary); border-color: var(--color-primary-hover); border-radius: .85rem .25rem .85rem .85rem; }
.chat-message--support { justify-self: start; }
.chat-message p { white-space: normal; overflow-wrap: anywhere; }
.chat-message__body p { margin: 0 0 .5rem; }
.chat-message__body p:last-child { margin-bottom: 0; }
.chat-message__body a { color: var(--text-link); text-decoration: underline; overflow-wrap: anywhere; }
.chat-message__body ul, .chat-message__body ol { margin: .4rem 0 .4rem 1.2rem; }
.chat-message time { display: block; margin-top: .45rem; color: hsl(220, 10%, 48%); font-size: .7rem; }
.chat-message--customer time { color: hsla(0, 0%, 100%, .72); }
.chat-form { display: flex; flex-direction: column; gap: .5rem; padding: .8rem; background: hsl(222, 20%, 13%); border-top: 1px solid var(--surface-border); }
.chat-form__row { display: flex; align-items: flex-end; gap: .55rem; }
.chat-form__attach { position: relative; display: flex; align-items: center; justify-content: center; flex-shrink: 0; width: 42px; height: 42px; color: var(--text-secondary); background: hsl(222, 18%, 18%); border: 1px solid hsl(222, 16%, 30%); border-radius: var(--radius-md); cursor: pointer; }
.chat-form__attach:hover { color: var(--text-primary); border-color: var(--color-primary); }
.chat-form__attach svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 2; fill: none; }
.chat-form textarea { flex: 1; min-width: 0; min-height: 44px; max-height: 120px; padding: .7rem .85rem; color: var(--text-primary); background: hsl(222, 18%, 18%); border: 1px solid hsl(222, 16%, 30%); border-radius: .7rem; font: inherit; resize: vertical; }
.chat-form textarea::placeholder { color: var(--text-muted); }
.chat-form textarea:focus { border-color: var(--color-primary); outline: none; box-shadow: 0 0 0 3px var(--color-primary-dim); }
.chat-form .btn { align-self: stretch; padding: .5rem .75rem; border: 1px solid var(--color-primary); border-radius: .7rem; color: var(--text-primary); background: var(--surface-3); }
.chat-form .btn:hover { color: #fff; background: var(--color-primary); }
.chat-attachments { display: flex; flex-wrap: wrap; gap: .4rem; list-style: none; }
.chat-attachments[hidden] { display: none; }
.chat-attachment-pill { display: inline-flex; align-items: center; gap: .35rem; max-width: 100%; padding: .25rem .8rem .25rem .7rem; font-size: .75rem; color: var(--text-secondary); background: var(--surface-2); border: 1px solid var(--surface-border); border-radius: var(--radius-full); }
.chat-attachment-pill span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-attachment-pill button { display: flex; align-items: center; justify-content: center; width: 1.1rem; height: 1.1rem; border-radius: 50%; color: var(--text-muted); background: transparent; line-height: 1; }
.chat-attachment-pill button:hover { color: var(--color-danger); background: var(--surface-3); }
.chat-attachment-list { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .6rem; }
.chat-message--customer .chat-attachment-list { justify-content: flex-end; }
.chat-attachment--image { flex: 0 1 auto; max-width: 220px; }
.chat-attachment--image img { width: 100%; max-height: 150px; object-fit: cover; border-radius: var(--radius-md); border: 1px solid var(--surface-border); display: block; }
.chat-attachment--file { display: inline-flex; align-items: center; gap: .4rem; max-width: 100%; padding: .4rem .7rem; font-size: .75rem; color: var(--text-secondary); background: hsl(222, 18%, 20%); border: 1px solid hsl(222, 16%, 30%); border-radius: var(--radius-md); overflow-wrap: anywhere; text-decoration: none; }
.chat-attachment--file::before { content: ''; width: .9rem; height: .9rem; flex-shrink: 0; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m21.44 11.05-9.19 9.19a6 6 0 0 1-8.49-8.49l9.19-9.19a4 4 0 0 1 5.66 5.66l-9.2 9.19a2 2 0 0 1-2.83-2.83l8.49-8.48'/%3E%3C/svg%3E") center/contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m21.44 11.05-9.19 9.19a6 6 0 0 1-8.49-8.49l9.19-9.19a4 4 0 0 1 5.66 5.66l-9.2 9.19a2 2 0 0 1-2.83-2.83l8.49-8.48'/%3E%3C/svg%3E") center/contain no-repeat; }
.support-chat .support-loading, .support-chat .support-form__status { margin: 0; padding: 2rem 1rem; background: hsl(222, 20%, 10%); }
.support-chat .chat-closed { max-height: 45dvh; margin: 0; overflow-y: auto; border: 0; border-top: 1px solid var(--surface-border); border-radius: 0; }
@keyframes chatPop { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
.chat-closed { margin-top: .75rem; padding: 1rem; border: 1px solid hsla(38, 95%, 52%, .35); border-radius: var(--radius-md); background: hsla(38, 95%, 52%, .08); }
.chat-closed strong { color: var(--color-warning); }
.chat-closed p { margin-top: .35rem; color: var(--text-secondary); }
.reopen-form { display: grid; gap: .75rem; margin-top: 1rem; }
.reopen-form label { display: grid; gap: .4rem; color: var(--text-secondary); font-size: .8rem; font-weight: 600; }
.reopen-form select, .reopen-form textarea { width: 100%; padding: .65rem .75rem; color: var(--text-primary); background: var(--surface-2); border: 1px solid var(--surface-border); border-radius: var(--radius-sm); font: inherit; }
@media (max-width: 640px) { .support-main { padding: 2.5rem 1rem 4rem; } .support-form { padding: 1rem; } .support-form__actions { justify-content: stretch; } .support-form__actions .btn { flex: 1; justify-content: center; } }
@media (max-width: 640px) { .ticket-card { grid-template-columns: 1fr auto; } .ticket-card strong { grid-column: 1 / -1; grid-row: 1; } .ticket-card__number { grid-row: 2; } .ticket-card time { grid-column: 1 / -1; } .support-chat { right: .5rem; bottom: .5rem; width: calc(100vw - 1rem); max-height: calc(100dvh - 1rem); border-radius: .85rem; } .support-chat .support-section__heading { padding: .8rem .9rem; } .chat-messages { max-height: 38dvh; padding: .8rem; } .chat-message { max-width: 94%; } .chat-form { align-items: stretch; padding: .65rem; } .chat-form .btn { flex-shrink: 0; } .support-chat .chat-closed { max-height: 42dvh; padding: .8rem; } }