:root {
    --bg: #050816;
    --bg2: #0f172a;
    --card: #111827;
    --card2: #1f2937;
    --text: #f9fafb;
    --muted: #9ca3af;
    --border: #263244;
    --blue: #2563eb;
    --green: #16a34a;
    --red: #dc2626;
    --gray: #6b7280;
    --yellow: #f59e0b;
    --purple: #7c3aed;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
}

.topo {
    background: linear-gradient(180deg, #0f172a, #050816);
    color: #fff;
    padding: 16px 14px;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 20;
}

.topo-conteudo {
    max-width: 1180px;
    margin: auto;
    display: flex;
    align-items: center;
    gap: 14px;
}

.logo-topo {
    width: 78px;
    height: 52px;
    object-fit: contain;
    flex-shrink: 0;
}

.topo-texto {
    flex: 1;
    min-width: 0;
}

.topo-texto h1 {
    margin: 0;
    font-size: 20px;
    line-height: 1.2;
    color: #fff;
}

.topo-texto p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.container {
    padding: 14px;
    max-width: 1180px;
    margin: auto;
}

.box,
.card,
.cliente-card,
.modelo-card,
.plano-card {
    background: var(--card);
    color: var(--text);
    padding: 14px;
    border-radius: 14px;
    margin-bottom: 14px;
    border: 1px solid var(--border);
    box-shadow: 0 8px 20px rgba(0,0,0,0.22);
}

.box {
    overflow: hidden;
}

h1,
h2,
h3 {
    color: var(--text);
}

h2 {
    font-size: 18px;
    margin: 0 0 12px;
    line-height: 1.25;
}

h3 {
    font-size: 15px;
    margin: 18px 0 10px;
    color: #d1d5db;
    line-height: 1.3;
}

label {
    font-size: 13px;
    font-weight: bold;
    display: block;
    margin-bottom: 5px;
    color: #e5e7eb;
}

input,
textarea,
select {
    width: 100%;
    padding: 13px;
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-bottom: 10px;
    box-sizing: border-box;
    font-size: 16px;
    background: #020617;
    color: var(--text);
    outline: none;
}

input:focus,
textarea:focus,
select:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59,130,246,.18);
}

input[readonly],
textarea[readonly] {
    opacity: .85;
    background: #0b1120;
}

input::placeholder,
textarea::placeholder {
    color: #6b7280;
}

textarea {
    min-height: 78px;
    resize: vertical;
}

button,
.botao,
.voltar {
    width: 100%;
    display: block;
    background: var(--blue);
    color: #fff;
    border: 0;
    padding: 14px;
    border-radius: 12px;
    font-weight: bold;
    font-size: 16px;
    cursor: pointer;
    margin-bottom: 10px;
    text-align: center;
    text-decoration: none;
    line-height: 1.2;
}

button:hover,
.botao:hover,
.voltar:hover,
.btn-editar:hover {
    filter: brightness(1.08);
}

button:active,
.botao:active,
.voltar:active,
.btn-editar:active {
    transform: scale(.99);
}

.voltar,
.btn-preto {
    background: #020617;
    border: 1px solid var(--border);
}

.btn-verde {
    background: var(--green);
}

.btn-vermelho {
    background: var(--red);
}

.btn-cinza {
    background: var(--gray);
}

.btn-amarelo {
    background: var(--yellow);
    color: #111827;
}

.btn-azul {
    background: var(--blue);
    color: #fff;
}

.btn-roxo {
    background: var(--purple);
    color: #fff;
}

.btn-editar {
    width: 100%;
    display: block;
    background: #1e3a8a;
    color: #dbeafe;
    text-align: center;
    text-decoration: none;
    padding: 14px;
    border-radius: 12px;
    font-weight: bold;
    margin-bottom: 8px;
}

.mensagem,
.mensagem-ok {
    background: #052e16;
    color: #bbf7d0;
    padding: 12px;
    border-radius: 10px;
    margin-bottom: 12px;
    border: 1px solid #166534;
    font-size: 14px;
}

.ajuda {
    font-size: 12px;
    color: var(--muted);
    margin-top: -4px;
    margin-bottom: 10px;
    line-height: 1.4;
}

.grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
}

.cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-bottom: 16px;
}

.acoes,
.variaveis {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    align-items: start;
}

.acoes form,
.variaveis form {
    margin: 0;
}

.card span,
.cliente-card span,
.modelo-card span,
.plano-card span {
    display: block;
    font-size: 14px;
    color: var(--muted);
    margin-bottom: 4px;
    line-height: 1.35;
    word-break: break-word;
}

.card strong,
.cliente-card strong,
.modelo-card strong,
.plano-card strong {
    display: block;
    font-size: 19px;
    color: var(--text);
    margin-bottom: 6px;
    line-height: 1.25;
    word-break: break-word;
}

.status,
.tag {
    display: inline-block;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 12px;
    background: #374151;
    color: #f3f4f6;
    margin: 4px 4px 8px 0;
    font-weight: 700;
}

.tag-sistema {
    background: #1e3a8a;
    color: #dbeafe;
}

.tag-propria,
.status.ativo {
    background: #14532d;
    color: #bbf7d0;
}

.tag-inativo,
.status.inativo {
    background: #7f1d1d;
    color: #fecaca;
}

.status.em_confianca,
.status.confianca {
    background: #78350f;
    color: #fde68a;
}

.modelo-texto {
    white-space: pre-wrap;
    background: #020617;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px;
    font-size: 14px;
    color: var(--text);
    margin-bottom: 10px;
    overflow-wrap: anywhere;
    line-height: 1.45;
}

.variavel-btn {
    background: #1f2937;
    color: #f9fafb;
    border: 1px solid var(--border);
    padding: 10px;
    border-radius: 10px;
    font-size: 13px;
    margin: 0;
    text-align: center;
}

.sair {
    color: #fecaca;
    font-size: 14px;
    text-decoration: none;
    margin-left: auto;
    white-space: nowrap;
}

.dispositivo-bloco,
.acesso-bloco {
    display: none;
    background: #020617;
    border: 1px solid var(--border);
    padding: 12px;
    border-radius: 12px;
    margin-bottom: 12px;
}

.subtitulo {
    font-size: 14px;
    margin: 14px 0 10px;
    color: #f9fafb;
    font-weight: bold;
}

.campo-indicacao {
    display: none;
}

::-webkit-scrollbar {
    width: 9px;
    height: 9px;
}

::-webkit-scrollbar-track {
    background: #020617;
}

::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 999px;
}

@media (min-width: 700px) {
    .grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .cards {
        grid-template-columns: repeat(2, 1fr);
    }

    .acoes {
        grid-template-columns: repeat(2, 1fr);
    }

    .variaveis {
        grid-template-columns: repeat(3, 1fr);
    }

    .voltar,
    .botao,
    button,
    .btn-editar {
        width: auto;
        display: inline-block;
        min-width: 140px;
    }

    form button {
        width: auto;
    }

    .acoes button,
    .acoes .botao,
    .acoes .btn-editar,
    .acoes .voltar {
        width: 100%;
        display: block;
        min-width: 0;
    }
}

@media (min-width: 1000px) {
    .cards {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 699px) {
    .container {
        padding: 12px;
    }

    .box,
    .card,
    .cliente-card,
    .modelo-card,
    .plano-card {
        padding: 13px;
        border-radius: 13px;
        margin-bottom: 12px;
    }

    .cards {
        gap: 9px;
    }

    .card strong,
    .cliente-card strong,
    .modelo-card strong,
    .plano-card strong {
        font-size: 18px;
    }

    .acoes {
        gap: 8px;
    }

    .acoes button,
    .acoes .botao,
    .acoes .btn-editar,
    .acoes .voltar {
        margin-bottom: 0;
    }

    input,
    textarea,
    select {
        padding: 12px;
    }
}

@media (max-width: 420px) {
    .topo {
        padding: 13px 12px;
    }

    .topo-conteudo {
        gap: 10px;
    }

    .logo-topo {
        width: 64px;
        height: 44px;
    }

    .topo-texto h1 {
        font-size: 18px;
    }

    .topo-texto p {
        font-size: 12px;
    }

    .sair {
        font-size: 12px;
    }

    button,
    .botao,
    .voltar,
    .btn-editar {
        font-size: 15px;
        padding: 13px;
    }

    h2 {
        font-size: 17px;
    }

    h3 {
        font-size: 14px;
    }
}