:root {
    --bg: #000;
    /* fallback */
    --bg-img: url('https://groomlake.com.br/imagens_v2/v3_fundo.png');
    --bg-overlay: rgba(0, 0, 0, .60);
    --bg-soft: rgba(255, 255, 255, 0.06);
    --text: #ffffff;
    --muted: #ffffff;
    --primary: #006c80;
    --primary-ink: #ffffff;
    --border: #266154;
}

* {
    box-sizing: border-box
}


body {
    margin: 0;
    font-family: ui-sans-serif, system-ui, Segoe UI, Arial;
    color: var(--text);
    display: flex;
    align-items: center;
    padding: 24px;
    background: linear-gradient(0deg, var(--bg-overlay), var(--bg-overlay)),
        var(--bg-img) center / cover no-repeat fixed;
}



.container {
    display: flex;
    flex-direction: column;
    width: min(100rem, 90vw);
    height: 100%;
    padding: 20px;
    ;
}



/* ===== Input com ícone ===== */
.input-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon .icon {
    position: absolute;
    left: 10px;
    font-size: 1.1rem;
    color: var(--muted);
    pointer-events: none;
}

.input-icon input {
    padding-left: 36px;
    /* espaço pro ícone */
}

.card {
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: 10px;
    /* box-shadow: 0 20px 25px rgba(255, 196, 0, 0.267); */
    padding: 30px;
    margin: 20px;

}

.center {
    text-align: center
}

.row {
    display: flex;
    gap: 16px;
    align-items: center;
}

.row.wrap {
    flex-wrap: wrap
}

.space {
    height: 12px
}

h1,
h2,
h3 {
    margin: .2rem 0 1rem
}

h1 {
    font-size: 1.6rem
}

h2 {
    font-size: 1.2rem;
    color: var(--muted)
}

label {
    display: block;
    font-size: .9rem;
    color: var(--muted);
    margin: .6rem 0 .3rem
}

input,
textarea,
select {
    width: 100%;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: #222222;
    color: #ffffff;
    outline: none;
    font-size: 1rem;
}

.cardReset {
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 30px;
    max-width: 600px;
    width: 100%;
}

textarea {
    min-height: 140px;
    resize: vertical
}

button,
.btn {
    text-decoration: none;
    appearance: none;
    border: none;
    cursor: pointer;
    /* margin: 5px; */
    padding: 12px 16px;
    border-radius: 12px;
    font-weight: 600;
    background: var(--primary);
    color: var(--primary-ink)
}

.btn.secondary {
    background: #bd0000;
    color: #ffffff
}

.btn.link {
    background: transparent;
    color: var(--primary);
    padding: 0
}

.rstpa {
    text-align: center;
    margin-top: 10px;
}

.rstpa a {
    text-decoration: none;
    color: white;
}

nav a.btn {
    text-decoration: none;
    display: inline-block;
    margin-right: 8px
}

ul.list {
    list-style: none;
    padding: 0;
    margin: 0
}

ul.list li {
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    margin: .7rem 0;
    background: #000000;
    ;
}

header.appbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px
}

header.appbar img {
    height: 60px

}

header.appbar .links a {
    margin-left: 8px
}

.muted {
    color: var(--muted)
}

.grid-2 {
    display: flex;
    grid-template-columns: 1fr 1fr;
    gap: 16px
}

/* .grid-2 {
    grid-template-columns: 1fr 1fr;
    gap: 20px
} */

.formLogin {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

@media (max-width:780px) {
    .grid-2 {
        grid-template-columns: 1fr
    }
}

/* ==== Ticket Detail layout tweaks ==== */
body.page-detail {
    align-items: flex-start;
    /* evita colar no topo quando o conteúdo é alto */
    padding-top: 24px;
}

.card.scrollable {
    max-height: 110vh;
    /* janela contida */
    display: flex;
    flex-direction: column;
}

#followups {
    flex: 1;
    min-height: 460px;
    max-height: 60vh;
    /* APENAS a timeline rola */
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px;
    background: #000000;
}

/* elementos individuais (só estética) */
.followup {
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    margin: .4rem 0;
    background: #0f0f0ed2
}

.followup .meta {
    font-size: .85rem;
    color: var(--muted);
    margin-bottom: 6px
}

#replyMsg {
    font-size: 1rem;
    /* para ficar igual ao input */
    font-family: ui-sans-serif, system-ui, Segoe UI, Arial;
    margin-bottom: 12px;
}

/* .followup .content{white-space:pre-wrap} */

/* ====== Tabela da lista de tickets ====== */
.tickets {
    margin-top: 6px;
}

.tickets-header,
.tickets-row {
    display: grid;
    grid-template-columns: 100px 1fr 200px 200px;
    /* ID | Título | Status | Criado */
    gap: 15px;
    align-items: center;
}

.tickets-header {
    color: var(--muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04rem;
    padding: 8px 6px;
}

.tickets-body {
    margin-top: 1px;
}

.tickets-row {
    background: #00000078;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px;
    margin: 6px 0;
    text-decoration: none;
    /* <a> como linha clicável */
    color: inherit;
}

.tickets-row:hover {
    border-color: var(--primary);
}

/* Colunas úteis para truncar título grande */
.cell.title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ====== Badge de status ====== */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: .95rem;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid transparent;
    display: inline-block;
}

/* Cores/padrões pedidos */
.dot-green {
    background: #3adc73;
    border-color: #3adc73;
}

/* 1 - Novo */
.dot-outline-grn {
    background: transparent;
    border-color: #3adc73;
}

/* 2 - Em atendimento */
.dot-red {
    background: #ff4a5b;
    border-color: #ff4a5b;
}

/* 4 - Pendente */
.dot-outline-blk {
    background: transparent;
    border-color: #0e172c;
}

/* 5 - Solucionado */
.dot-black {
    background: #0e1628;
    border-color: #0e1628;
}

/* 6 - Fechado */

/* Ícone de calendário (3 - Em atendimento agendado) */
.icon-calendar {
    width: 16px;
    height: 16px;
    display: inline-flex;
}

.icon-calendar svg {
    width: 16px;
    height: 16px;
    stroke: #ffffff;
    fill: none;
}


/* ====== Dashboard (MainUI) ====== */
.kpis {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 12px;
}

.kpi {
    border-radius: 14px;
    padding: 16px;
    color: #fff;
}

.kpi .label {
    font-size: .9rem;
    margin-bottom: 6px;
    opacity: 0.85;
}

.kpi .value {
    font-size: 1.8rem;
    font-weight: 700;
}

/* Cores específicas */
.kpi.total {
    background: #213ebc;
    /* cinza */
}

.kpi.open {
    background: #2e7d32;
    /* verde */
}

.kpi.closed {
    background: #3f0047;
    /* azul */
}

@media (max-width: 720px) {
    .kpis {
        grid-template-columns: 1fr;
    }
}

/* ===== Alertas ===== */
.alert {
    display: none;
    background: #331f20;
    border: 1px solid #c0392b;
    color: #ffd7d7;
    padding: 10px 12px;
    border-radius: 10px;
    margin: 8px 0 12px;
    font-size: .95rem;
}

.alert.show {
    display: block;
}

/* ===== Toasts ===== */
.toast-container {
    position: fixed;
    right: 14px;
    top: 14px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    min-width: 260px;
    max-width: min(420px, 92vw);
    border-radius: 12px;
    padding: 12px 14px;
    color: #fff;
    box-shadow: 0 10px 25px rgba(0, 0, 0, .35);
    border: 1px solid rgba(255, 255, 255, .12);
    animation: slideIn .25s ease, fadeOut .3s ease 4.2s forwards;
}

.toast.success {
    background: #2e7d32;
}

.toast.error {
    background: #2852c6;
}

.toast.info {
    background: #750800;
}

@keyframes slideIn {
    from {
        transform: translateY(-10px);
        opacity: 0
    }

    to {
        transform: translateY(0);
        opacity: 1
    }
}

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: translateY(-8px)
    }
}



/* ===== Chat style para followups ===== */

.chat-thread {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.day-sep {
    display: inline-block;
    align-self: center;
    font-size: .8rem;
    color: var(--muted);
    background: #480069;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 4px 10px;
    margin: 6px 0 4px;
}

.msg {
    display: grid;
    grid-template-columns: 40px 1fr;
    gap: 10px;
    align-items: end;
}

.msg.mine {
    /* suas mensagens (direita) */
    grid-template-columns: 1fr 40px;
}

.msg.mine .bubble {
    background: #005004;
    color: #fff;
    border-color: transparent;
}

.msg.mine .meta {
    text-align: right;
}

.msg.mine .avatar {
    justify-self: end;
    background: #002dc0;
}

.msg.other .bubble {
    background: #003849;
    border-color: var(--border);
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 40%;
    background: #54038a;
    color: #cfe5ff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    user-select: none;
}

.bubble {
    border: 1px solid transparent;
    border-radius: 14px;
    padding: 10px 12px;
    box-shadow: 0 6px 14px rgba(0, 0, 0, .25);
    white-space: pre-wrap;
    word-wrap: break-word;
}

.meta {
    font-size: .78rem;
    color: var(--muted);
    margin-top: 4px;
}

.msg.mine .wrap {
    order: 1;
}

/* texto antes do avatar no grid à direita */
.msg.mine .avatar {
    order: 2;
}

/* Mantém nosso container rolável como antes */
#followups.chat-thread {
    padding: 12px;
    background: #171718a6;
    border: 1px solid var(--border);
    border-radius: 10px;
}

/* ========= LAYOUT COM SIDEBAR (MainUI e páginas internas) ========= */
/* override do body deste tema para liberar largura/altura totais */
body {
    display: block;
    padding: 0;
    min-height: 100vh;
}

/* grid principal: sidebar + conteúdo */
.app-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: 100vh;
    gap: 0;
    background: transparent;
}

/* área de conteúdo (onde ficam seus cards existentes) */
.content {
    padding: 10px 20px 10px;
    min-width: 0;
}

/* ========= SIDEBAR ========= */
.sidebar {
    position: sticky;
    top: 0;
    height: 95vh;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 14px;
    background: rgba(255, 255, 255, 0.04);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(6px);
    transition: width .25s ease, padding .25s ease;
    width: 260px;
    z-index: 3;
    margin: 15px;
    border-radius: 15px;
}

/* estado colapsado */
.sidebar[data-state="collapsed"] {
    width: 76px;
    padding: 14px 10px;
}

/* cabeçalho da sidebar */
.sb-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 8px 12px;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.12);
}

.sb-toggle {
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #d9f2f0;
    cursor: pointer;
}

.sb-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
}

.sb-logo {
    font-weight: 800;
    letter-spacing: .6px;
    color: #dff7f4;
    font-size: 18px;
    white-space: nowrap;
    transition: opacity .2s ease;
}

.sidebar[data-state="collapsed"] .sb-logo {
    opacity: 0;
    pointer-events: none;
}

/* navegação */
.sb-nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 8px;
}

.sb-link,
.sb-logout {
    display: grid;
    grid-template-columns: 36px 1fr;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    color: #d9f2f0;
    text-decoration: none;
    background: transparent;
    border: 1px solid transparent;
    transition: background .2s ease, border-color .2s ease, color .2s ease;
    cursor: pointer;
}

.sb-link:hover,
.sb-logout:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1);
}

.sb-link.active {
    background: rgba(35, 160, 148, 0.15);
    border-color: rgba(35, 160, 148, 0.35);
    color: #eafffb;
}

.sb-icon {
    display: inline-grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #bfe7e4;
}

.sb-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar[data-state="collapsed"] .sb-text {
    display: none;
}

/* rodapé da sidebar */
.sb-footer {
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px dashed rgba(255, 255, 255, 0.12);
}

.sb-logout {
    width: 100%;
    text-align: left;
    color: #ffd7d7;
    background: rgba(255, 0, 0, 0.05);
    border-color: rgba(255, 0, 0, 0.18);
}

.sb-logout:hover {
    background: rgba(255, 0, 0, 0.12);
}

/* ========= RESPONSIVO ========= */
@media (max-width: 1024px) {
    .app-layout {
        grid-template-columns: 76px 1fr;
    }

    .sidebar {
        width: 76px;
    }

    .sidebar[data-state="expanded"] {
        position: fixed;
        left: 0;
        transform: translateX(0);
    }

    .sidebar[data-state="collapsed"] {
        position: fixed;
        left: 0;
        transform: translateX(-8px);
    }
}

/* ===== Calendar minimal styles (sem libs) ===== */
.calendar-bar {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.calendar-bar .left,
.calendar-bar .right {
    display: flex;
    gap: 8px;
    align-items: center;
}

.view-switch button {
    background: #314766;
    color: #dbe7f1;
}

.view-switch button.active {
    background: var(--primary);
    color: var(--primary-ink);
}

.cal-grid {
    display: grid;
    gap: 6px;
}

.cal-grid.month {
    grid-template-columns: repeat(7, 1fr);
}

.cal-cell {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 6px;
    min-height: 96px;
    background: #292c33;
    position: relative;
}

.cal-cell .date {
    font-size: .85rem;
    color: var(--muted);
    margin-bottom: 6px;
}

.event {
    background: #1565c0;
    color: #fff;
    padding: 4px 6px;
    border-radius: 8px;
    margin: 3px 0;
    font-size: .85rem;
    cursor: pointer;
}

.event.mine {
    background: #2e7d32;
}

.event.conflict {
    background: #c62828;
}

.cal-list .row {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 10px;
    margin: 5px 0;
    background: #0b162f;
}

.badge {
    font-size: .8rem;
    padding: 3px 6px;
    border-radius: 10px;
    background: #314766;
    color: #dbe7f1;
}

.inline-form {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.inline-form input,
.inline-form select {
    width: auto;
}

.dialog {
    position: fixed;
    inset: 0;
    display: none;
    place-items: center;
    background: rgba(0, 0, 0, .45);
    z-index: 9999;
}

.dialog .panel {
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 16px;
    width: min(560px, 92vw);
}

.dialog.show {
    display: grid;
}

.urg-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 10px;
    font-weight: 600
}

.urg-1 {
    background: #264653;
    color: #cdeaf1
}

.urg-2 {
    background: #2a9d8f;
    color: #eafff8
}

.urg-3 {
    background: #e9c46a;
    color: #1b1200
}

.urg-4 {
    background: #f4a261;
    color: #1b0c00
}

.urg-5 {
    background: #e76f51;
    color: #fff
}