:root {
  font-family: Inter, system-ui, sans-serif;
  color: #172033;
  background: #f5f7fb;
  --green: #00a884;
  --nav: #111827;
  --line: #dfe5ec;
}
* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
body {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
}
button {
  border: 0;
  border-radius: 8px;
  padding: 0.7rem 1rem;
  background: var(--green);
  color: #fff;
  cursor: pointer;
}
.secondary {
  background: #edf1f5;
  color: #253247;
}
.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: #e9f5f2;
}
.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 12px 40px #102a4320;
}
.login-card {
  width: min(410px, 92vw);
  padding: 2rem;
}
.login-card h1 {
  margin: 0.2rem 0;
}
.login-card p {
  color: #64748b;
}
.login-card button {
  width: 100%;
}
label {
  display: grid;
  gap: 0.4rem;
  margin: 1rem 0;
  font-weight: 600;
  font-size: 0.9rem;
}
input,
select,
textarea {
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 0.7rem;
  width: 100%;
  background: #fff;
}
textarea {
  min-height: 90px;
}
.error {
  color: #c62828;
}
#app:not([hidden]) {
  display: grid;
  grid-template-columns: 230px 1fr;
  min-height: 100vh;
}
aside {
  background: var(--nav);
  color: #fff;
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
}
.brand {
  font-size: 1.25rem;
  font-weight: 800;
  margin: 0.5rem 0 1.8rem;
}
nav {
  display: grid;
  gap: 0.35rem;
}
nav button {
  text-align: left;
  background: transparent;
  color: #cbd5e1;
}
nav button.active {
  background: var(--green);
  color: #fff;
}
aside footer {
  display: grid;
  gap: 0.8rem;
  margin-top: auto;
}
main {
  padding: 1.8rem;
  min-width: 0;
}
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.4rem;
}
h1 {
  margin: 0;
}
small,
.muted {
  color: #64748b;
}
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 1rem;
}
.metric {
  padding: 1.2rem;
}
.metric strong {
  font-size: 2rem;
  display: block;
  margin-top: 0.4rem;
}
.table {
  overflow: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
}
table {
  border-collapse: collapse;
  width: 100%;
}
th,
td {
  padding: 0.8rem;
  text-align: left;
  border-bottom: 1px solid var(--line);
}
th {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: #64748b;
}

.ticket-workspace {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 0.75rem;
  height: 100%;
  min-height: 0;
}
.ticket-sidebar {
  display: grid;
  grid-template-rows: auto 1fr;
  min-width: 0;
  min-height: 0;
}
.ticket-tabs {
  display: flex;
  gap: 0.5rem;
  padding-bottom: 0.75rem;
}
.ticket-tabs button {
  flex: 1 1 auto;
}
.ticket-tabs button.active {
  background: var(--green);
  color: #fff;
}
.ticket-list,
.chat {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}


.ticket-list {
  overflow: auto;
}
.ticket {
  padding: 1rem;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}
.ticket:hover,
.ticket.selected {
  background: #e9f8f4;
}
.ticket b,
.ticket span {
  display: block;
}
.chat {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-width: 0;
  min-height: 0;
}

.chat-head {
  padding: 1rem;
  border-bottom: 1px solid var(--line);
}

/* aqui 3 */
.messages {
  padding: 1rem;
  overflow: auto;
  background: #efeae2;
}


/* .message {
  max-width: 75%;
  padding: 0.55rem 0.8rem;
  margin: 0.4rem 0;
  border-radius: 9px;
  background: #fff;
} */
.message.me {
  margin-left: auto;
  background: #d9fdd3;
}



/* aqui 4 */
.composer {
  display: flex;
  gap: 0.5rem;
  padding: 0.8rem;
  background: #f0f2f5;
}

/* .composer {
  flex-shrink: 0;
} */


.composer input {
  flex: 1;
}
.badge {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 20px;
  background: #e2e8f0;
  font-size: 0.75rem;
}
.toolbar {
  display: flex;
  gap: 0.6rem;
  margin-bottom: 1rem;
}
.toolbar input {
  max-width: 430px;
}
dialog {
  border: 0;
  border-radius: 14px;
  width: min(560px, 94vw);
  padding: 0;
  box-shadow: 0 20px 60px #0005;
}
dialog::backdrop {
  background: #0f172a99;
}
#modalForm {
  padding: 1.4rem;
}
.modal-title,
.actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}
.modal-title h2 {
  margin: 0;
}
.close {
  background: transparent;
  color: #475569;
  font-size: 1.4rem;
}
.actions {
  justify-content: flex-end;
  margin-top: 1.2rem;
}
#toast {
  display: none;
  position: fixed;
  right: 1.2rem;
  bottom: 1.2rem;
  padding: 0.8rem 1rem;
  background: #111827;
  color: #fff;
  border-radius: 8px;
}
@media (max-width: 800px) {
  #app:not([hidden]) {
    grid-template-columns: 1fr;
  }
  aside {
    position: sticky;
    top: 0;
    z-index: 3;
    display: block;
    padding: 0.6rem;
  }
  .brand,
  aside footer {
    display: none;
  }
  nav {
    display: flex;
    overflow: auto;
  }
  .ticket-workspace {
    grid-template-columns: 1fr;
    height: auto;
  }
  .ticket-list {
    max-height: 320px;
  }
  .chat {
    min-height: 520px;
  }
  main {
    padding: 0.8rem;
  }
}
