:root{--red:#b3121b;--red2:#861018;--bg:#f3f5f8;--text:#202331;--muted:#747985;--line:#e2e6eb;--white:#fff}
*{box-sizing:border-box}body{margin:0;font-family:Inter,Segoe UI,Arial,sans-serif;background:var(--bg);color:var(--text)}
a{color:var(--red);text-decoration:none}.top-nav{height:72px;padding:0 max(24px,5vw);display:flex;align-items:center;justify-content:space-between;background:#fff;border-bottom:1px solid var(--line)}
.brand{font-weight:900;font-size:20px;color:#222}.brand span{color:var(--red)}.top-nav nav{display:flex;gap:22px}.top-nav nav a{color:#414550;font-weight:600;font-size:14px}
.container{width:min(1180px,calc(100% - 32px));margin:34px auto}.page-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:24px}.page-head h1{margin:5px 0 0;font-size:32px}
.eyebrow{font-size:12px;font-weight:800;letter-spacing:.13em;color:var(--red)}.stats-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:16px;margin-bottom:24px}
.stat,.panel,.form-card{background:#fff;border:1px solid var(--line);border-radius:16px;box-shadow:0 12px 32px rgba(34,38,48,.06)}.stat{padding:22px}.stat span{display:block;color:var(--muted);font-size:13px}.stat strong{font-size:32px}
.panel{padding:22px}.panel-head{display:flex;justify-content:space-between}.table-wrap{overflow:auto}table{width:100%;border-collapse:collapse}th,td{padding:15px;border-bottom:1px solid var(--line);text-align:left;font-size:14px}
th{color:var(--muted);font-size:12px;text-transform:uppercase}.badge{display:inline-flex;padding:7px 10px;border-radius:999px;background:#fff1f2;color:var(--red);font-size:12px;font-weight:800}
.btn{display:inline-flex;align-items:center;justify-content:center;border:0;border-radius:10px;padding:12px 18px;font-weight:800;cursor:pointer}.primary{background:linear-gradient(135deg,var(--red),var(--red2));color:#fff}.secondary{background:#e9edf1;color:#343844}
.auth-shell{min-height:calc(100vh - 140px);display:grid;place-items:center}.auth-card{width:min(950px,100%);display:grid;grid-template-columns:1.1fr .9fr;background:#fff;border-radius:22px;overflow:hidden;box-shadow:0 20px 60px rgba(30,35,45,.12)}
.auth-copy{padding:60px;background:linear-gradient(145deg,#fff2f3,#fff)}.auth-copy h1{font-size:44px;line-height:1.05}.auth-form{padding:52px;display:flex;flex-direction:column;justify-content:center}
.form-card{padding:28px}.narrow{width:min(520px,100%)}label{display:block;margin:14px 0 7px;font-size:13px;font-weight:700}input,select,textarea{width:100%;border:1px solid var(--line);border-radius:10px;padding:12px;background:#fff;font:inherit}
input:focus,select:focus,textarea:focus{outline:3px solid rgba(179,18,27,.1);border-color:var(--red)}.auth-form .btn,.form-card .btn{margin-top:18px}.muted{color:var(--muted);font-size:14px}.alert{padding:12px;border-radius:10px}.error{background:#fff0f1;color:#9e141b}
.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:18px}.full{grid-column:1/-1}.actions{text-align:right}.filters{display:grid;grid-template-columns:1fr 240px auto;gap:12px;margin-bottom:18px}
.ticket-layout{display:grid;grid-template-columns:minmax(0,1fr) 320px;gap:20px}.ticket-text{line-height:1.7}.messages{display:flex;flex-direction:column;gap:12px;margin:16px 0}
.message{padding:14px;border-radius:12px;background:#f5f7f9}.admin-msg{background:#fff0f1}.message small{display:block;color:var(--muted);margin-top:3px}.reply-box textarea{margin-bottom:10px}
dl{display:grid;grid-template-columns:110px 1fr;gap:10px;font-size:14px}dt{color:var(--muted)}dd{margin:0;font-weight:600}
@media(max-width:800px){.stats-grid{grid-template-columns:1fr 1fr}.auth-card,.ticket-layout{grid-template-columns:1fr}.auth-copy{display:none}.form-grid{grid-template-columns:1fr}.full{grid-column:auto}.filters{grid-template-columns:1fr}.top-nav nav{gap:10px}.top-nav nav a{font-size:12px}}

.row-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.btn.small {
    padding: 8px 11px;
    font-size: 12px;
}

.btn.danger {
    background: #fff0f1;
    color: #a3131b;
}

.btn.danger:hover {
    background: #ffdfe2;
}

.badge-success {
    background: #e8f8ef;
    color: #167344;
}

.badge-disabled {
    background: #edf0f3;
    color: #676d76;
}

table td {
    vertical-align: middle;
}

@media (max-width: 900px) {
    .row-actions {
        min-width: 180px;
    }
}

.success {
    background: #e8f8ef;
    color: #167344;
    border: 1px solid #bde8cf;
    margin-bottom: 18px;
}

.form-card {
    max-width: 900px;
}

.actions {
    display: flex;
    justify-content: flex-end;
}
.ticket-section {
    margin-bottom: 20px;
}

.ticket-section h2,
.ticket-management h2 {
    margin-top: 0;
}

.ticket-text {
    margin-top: 18px;
    padding: 20px;
    border-radius: 12px;
    background: #f7f8fa;
    white-space: normal;
    word-break: break-word;
}

.information-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    margin-top: 15px;
}

.information-item {
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fafbfc;
}

.information-item span {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 12px;
}

.information-item strong {
    font-size: 14px;
    word-break: break-word;
}

.ticket-management {
    margin-bottom: 20px;
}

.ticket-management label {
    margin-top: 16px;
}

.full-button {
    width: 100%;
}

.ticket-details h3 {
    margin-top: 0;
}

.attachment-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fafbfc;
}

.attachment-card small {
    display: block;
    margin-top: 5px;
    color: var(--muted);
}

.success {
    margin-bottom: 18px;
    padding: 13px 16px;
    border: 1px solid #bde8cf;
    border-radius: 10px;
    background: #e8f8ef;
    color: #167344;
}

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

    .attachment-card {
        align-items: flex-start;
        flex-direction: column;
    }

    .attachment-card .btn {
        width: 100%;
    }
}

/* =========================================================
   LAYOUT DO CHAMADO
========================================================= */

.ticket-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 22px;
    align-items: start;
}

.ticket-main {
    min-width: 0;
}

.ticket-sidebar {
    position: sticky;
    top: 20px;
}

.ticket-section {
    margin-bottom: 22px;
}

.ticket-section h2,
.ticket-management h2 {
    margin: 5px 0 0;
}

.ticket-section .panel-head {
    align-items: center;
}

.full-button {
    width: 100%;
}

/* =========================================================
   DESCRIÇÃO
========================================================= */

.ticket-text {
    margin-top: 18px;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: #f7f8fa;
    color: #303440;
    font-size: 14px;
    line-height: 1.8;
    overflow-wrap: anywhere;
}

/* =========================================================
   INFORMAÇÕES DO CLIENTE
========================================================= */

.information-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-top: 18px;
}

.information-item {
    min-width: 0;
    padding: 17px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fafbfc;
}

.information-item span {
    display: block;
    margin-bottom: 7px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.information-item strong {
    display: block;
    color: var(--text);
    font-size: 14px;
    overflow-wrap: anywhere;
}

/* =========================================================
   ANEXO ORIGINAL DO CHAMADO
========================================================= */

.attachment-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-top: 16px;
    padding: 17px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fafbfc;
}

.attachment-information {
    display: flex;
    align-items: center;
    gap: 13px;
    min-width: 0;
}

.attachment-icon {
    flex-shrink: 0;
    font-size: 26px;
}

.attachment-information div {
    min-width: 0;
}

.attachment-information strong {
    display: block;
    color: var(--text);
    font-size: 14px;
    overflow-wrap: anywhere;
}

.attachment-information small {
    display: block;
    margin-top: 5px;
    color: var(--muted);
}

/* =========================================================
   PAINEL DE GESTÃO
========================================================= */

.ticket-management {
    margin-bottom: 20px;
}

.ticket-management h2 {
    margin-bottom: 20px;
}

.ticket-management label {
    margin-top: 16px;
}

.ticket-management .btn {
    margin-top: 20px;
}

/* =========================================================
   DETALHES LATERAIS
========================================================= */

.ticket-details h3 {
    margin: 5px 0 22px;
}

.ticket-details dl {
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr);
    gap: 13px 10px;
    margin: 0;
    font-size: 13px;
}

.ticket-details dt {
    color: var(--muted);
}

.ticket-details dd {
    margin: 0;
    color: var(--text);
    font-weight: 700;
    overflow-wrap: anywhere;
}

/* =========================================================
   CHAT
========================================================= */

.chat-panel {
    overflow: hidden;
}

.chat-panel-head {
    align-items: center;
    margin-bottom: 20px;
}

.message-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 11px;
    border-radius: 999px;
    background: #eef1f4;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.chat-messages {
    display: flex;
    flex-direction: column;
    gap: 13px;
    max-height: 600px;
    overflow-y: auto;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 15px;
    background: #f5f7f9;
    scroll-behavior: smooth;
}

/* =========================================================
   MENSAGEM
========================================================= */

.chat-message {
    width: min(78%, 650px);
    padding: 15px;
    border: 1px solid var(--line);
    border-left-width: 4px;
    border-radius: 15px 15px 15px 4px;
    background: #ffffff;
    box-shadow: 0 5px 18px rgba(25, 30, 40, 0.05);
}

.chat-message.my-message {
    align-self: flex-end;
    border-radius: 15px 15px 4px 15px;
    background: #fff2f3;
}

.message-cliente {
    border-left-color: #4477d4;
}

.message-tecnico {
    border-left-color: #239560;
}

.message-admin {
    border-left-color: var(--red);
}

.message-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 11px;
}

.message-header strong {
    display: block;
    color: var(--text);
    font-size: 14px;
}

.message-header time {
    color: var(--muted);
    font-size: 11px;
    white-space: nowrap;
}

.message-role {
    display: inline-block;
    margin-top: 3px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
}

.message-body {
    color: #303440;
    font-size: 14px;
    line-height: 1.7;
    overflow-wrap: anywhere;
}

/* =========================================================
   ANEXO DA MENSAGEM
========================================================= */

.message-attachment {
    display: flex;
    align-items: center;
    gap: 11px;
    margin-top: 13px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.8);
    transition:
        transform 0.2s ease,
        border-color 0.2s ease;
}

.message-attachment:hover {
    transform: translateY(-1px);
    border-color: var(--red);
}

.message-attachment > span {
    flex-shrink: 0;
    font-size: 23px;
}

.message-attachment div {
    min-width: 0;
}

.message-attachment strong {
    display: block;
    color: var(--text);
    font-size: 13px;
    overflow-wrap: anywhere;
}

.message-attachment small {
    display: block;
    margin-top: 3px;
    color: var(--muted);
}

/* =========================================================
   CHAT VAZIO
========================================================= */

.empty-chat {
    padding: 48px 20px;
    text-align: center;
    color: var(--muted);
}

.empty-chat-icon {
    display: block;
    margin-bottom: 12px;
    font-size: 34px;
}

.empty-chat strong {
    display: block;
    color: var(--text);
}

.empty-chat p {
    margin: 7px 0 0;
}

/* =========================================================
   FORMULÁRIO DE RESPOSTA
========================================================= */

.reply-box {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
}

.reply-box textarea {
    min-height: 125px;
    resize: vertical;
}

.reply-actions {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-top: 12px;
}

.file-area {
    flex: 1;
    min-width: 0;
}

.file-label {
    margin-top: 0;
}

.file-input {
    display: block;
    max-width: 440px;
    margin-top: 8px;
}

.file-area small {
    display: block;
    margin-top: 7px;
}

/* =========================================================
   ALERTA DE SUCESSO
========================================================= */

.success {
    margin-bottom: 18px;
    padding: 13px 16px;
    border: 1px solid #bde8cf;
    border-radius: 10px;
    background: #e8f8ef;
    color: #167344;
}

/* =========================================================
   RESPONSIVIDADE
========================================================= */

@media (max-width: 980px) {
    .ticket-layout {
        grid-template-columns: 1fr;
    }

    .ticket-sidebar {
        position: static;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 20px;
    }

    .ticket-management {
        margin-bottom: 0;
    }
}

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

    .ticket-sidebar {
        grid-template-columns: 1fr;
    }

    .attachment-card {
        align-items: flex-start;
        flex-direction: column;
    }

    .attachment-card .btn {
        width: 100%;
    }

    .chat-message {
        width: 94%;
    }

    .message-header {
        flex-direction: column;
        gap: 5px;
    }

    .reply-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .reply-actions .btn {
        width: 100%;
    }

    .file-input {
        max-width: 100%;
    }

    .chat-panel-head {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
    }
}
/* =========================================================
   DASHBOARD DO TÉCNICO
========================================================= */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 24px;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 15px;
    min-width: 0;
    padding: 21px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 8px 25px rgba(25, 30, 40, 0.05);
}

.stat-card-icon {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border-radius: 14px;
    background: #f3f4f6;
    font-size: 24px;
}

.stat-card span {
    display: block;
    margin-bottom: 5px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.stat-card strong {
    display: block;
    color: var(--text);
    font-size: 27px;
    line-height: 1;
}

.table-subtitle {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 11px;
}

.small-button {
    padding: 8px 12px;
    font-size: 12px;
}

.empty-state {
    padding: 50px 20px;
    text-align: center;
}

.empty-state-icon {
    margin-bottom: 12px;
    font-size: 40px;
}

.empty-state h3 {
    margin: 0 0 7px;
}

.empty-state p {
    margin: 0;
    color: var(--muted);
}

.badge-danger {
    background: #fde8ea;
    color: #b4232c;
}

.badge-warning {
    background: #fff3d7;
    color: #976500;
}

.badge-info {
    background: #e7f0ff;
    color: #245ea8;
}

.badge-success {
    background: #e4f6eb;
    color: #197044;
}

.badge-dark {
    background: #e5e7eb;
    color: #374151;
}

@media (max-width: 1050px) {
    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

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

    .stat-card {
        padding: 18px;
    }
}
/* =========================================================
   FILTROS DOS CHAMADOS
========================================================= */

.filter-form {
    margin-top: 20px;
}

.filter-grid {
    display: grid;
    grid-template-columns:
        minmax(220px, 2fr)
        minmax(170px, 1fr)
        minmax(170px, 1fr)
        auto;
    gap: 16px;
    align-items: end;
}

.form-group {
    min-width: 0;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
}

.filter-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

@media (max-width: 980px) {
    .filter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

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

    .filter-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-actions .btn {
        width: 100%;
    }
}
.notification-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    text-decoration: none;
    background: #f1f5f9;
    transition: 0.2s ease;
}

.notification-link:hover {
    background: #e2e8f0;
    transform: translateY(-1px);
}

.notification-bell {
    font-size: 18px;
    line-height: 1;
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 19px;
    height: 19px;
    padding: 0 5px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #dc2626;
    color: #ffffff;
    border: 2px solid #ffffff;
    font-size: 10px;
    font-weight: 800;
}

.notification-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.notification-item {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    padding: 16px;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: #ffffff;
}

.notification-item.is-unread {
    border-left: 4px solid #dc2626;
    background: #fffafa;
}

.notification-item.is-read {
    opacity: 0.78;
}

.notification-icon {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border-radius: 13px;
    background: #f1f5f9;
    font-size: 21px;
}

.notification-content p {
    margin: 6px 0;
    color: #475569;
}

.notification-content small {
    color: #94a3b8;
}

.notification-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.notification-new {
    padding: 3px 7px;
    border-radius: 999px;
    background: #dc2626;
    color: #ffffff;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
}

@media (max-width: 650px) {
    .notification-item {
        grid-template-columns: 42px 1fr;
    }

    .notification-item .btn {
        grid-column: 1 / -1;
    }
}
* {
    box-sizing: border-box;
}

:root {
    --cor-principal: #1d4ed8;
    --cor-principal-escura: #1e3a8a;
    --cor-texto: #111827;
    --cor-texto-secundario: #64748b;
    --cor-borda: #dbe2ea;
    --cor-fundo: #eef2f7;
    --cor-suave: #f8fafc;
    --cor-branca: #ffffff;
}

html {
    font-family:
        Arial,
        Helvetica,
        sans-serif;
}

body {
    margin: 0;
    padding: 25px;
    background: var(--cor-fundo);
    color: var(--cor-texto);
    font-size: 14px;
}

.barra-acoes {
    width: 100%;
    max-width: 210mm;
    margin: 0 auto 18px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.botao {
    min-height: 42px;
    padding: 10px 18px;
    border: 0;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        background 0.2s ease;
}

.botao:hover {
    transform: translateY(-1px);
}

.botao-voltar {
    background: #e2e8f0;
    color: #334155;
}

.botao-voltar:hover {
    background: #cbd5e1;
}

.botao-imprimir {
    background: var(--cor-principal);
    color: var(--cor-branca);
    box-shadow: 0 7px 18px rgba(29, 78, 216, 0.2);
}

.botao-imprimir:hover {
    background: var(--cor-principal-escura);
}

.pagina-a4 {
    width: 100%;
    max-width: 210mm;
    min-height: 297mm;
    margin: 0 auto;
    padding: 14mm;
    background: var(--cor-branca);
    border-radius: 4px;
    box-shadow: 0 15px 45px rgba(15, 23, 42, 0.12);
}

.cabecalho-ficha {
    padding-bottom: 18px;
    border-bottom: 3px solid var(--cor-principal);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 25px;
}

.cabecalho-logotipo {
    display: flex;
    align-items: center;
    gap: 14px;
}

.logotipo-marca {
    width: 58px;
    height: 58px;
    border-radius: 13px;
    display: grid;
    place-items: center;
    background: var(--cor-principal);
    color: var(--cor-branca);
    font-size: 20px;
    font-weight: 900;
    letter-spacing: 1px;
}

.cabecalho-ficha h1 {
    margin: 0;
    color: var(--cor-principal-escura);
    font-size: 22px;
    line-height: 1.2;
}

.cabecalho-ficha p {
    margin: 5px 0 0;
    color: var(--cor-texto-secundario);
    font-size: 13px;
}

.cabecalho-ticket {
    min-width: 150px;
    padding: 13px 18px;
    border: 1px solid var(--cor-borda);
    border-radius: 10px;
    background: var(--cor-suave);
    text-align: right;
}

.cabecalho-ticket span {
    display: block;
    color: var(--cor-texto-secundario);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.cabecalho-ticket strong {
    display: block;
    margin-top: 5px;
    color: var(--cor-principal);
    font-size: 18px;
}

.estado-ticket {
    margin-top: 16px;
    padding: 13px 16px;
    border-radius: 9px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
}

.estado-ticket > div {
    border-right: 1px solid #bfdbfe;
}

.estado-ticket > div:last-child {
    border-right: 0;
}

.rotulo-pequeno {
    display: block;
    margin-bottom: 4px;
    color: var(--cor-texto-secundario);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.estado-ticket strong {
    color: var(--cor-principal-escura);
    font-size: 13px;
}

.secao-ficha {
    margin-top: 20px;
}

.titulo-secao {
    margin-bottom: 11px;
    display: flex;
    align-items: center;
    gap: 9px;
}

.titulo-secao span {
    width: 27px;
    height: 27px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    background: var(--cor-principal);
    color: var(--cor-branca);
    font-size: 10px;
    font-weight: 800;
}

.titulo-secao h2 {
    margin: 0;
    color: var(--cor-principal-escura);
    font-size: 15px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.grelha-dados {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.campo {
    min-height: 58px;
    padding: 11px 13px;
    border: 1px solid var(--cor-borda);
    border-radius: 7px;
    background: var(--cor-branca);
}

.campo-grande {
    grid-column: span 1;
}

.campo-largura-total {
    grid-column: 1 / -1;
}

.campo-rotulo {
    display: block;
    margin-bottom: 6px;
    color: var(--cor-texto-secundario);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.campo strong {
    color: var(--cor-texto);
    font-size: 13px;
    word-break: break-word;
}

.texto-descricao {
    min-height: 50px;
    color: #334155;
    line-height: 1.55;
    white-space: normal;
    word-break: break-word;
}

.area-preenchimento {
    padding: 10px 13px 3px;
    border: 1px solid var(--cor-borda);
    border-radius: 7px;
}

.area-diagnostico,
.area-servico {
    min-height: 110px;
}

.area-observacao {
    margin-top: 13px;
    min-height: 90px;
}

.linha-preenchimento {
    height: 24px;
    border-bottom: 1px solid #cbd5e1;
}

.tabela-materiais {
    width: 100%;
    border-collapse: collapse;
}

.tabela-materiais th,
.tabela-materiais td {
    border: 1px solid var(--cor-borda);
    padding: 9px;
    text-align: left;
}

.tabela-materiais th {
    background: var(--cor-suave);
    color: #475569;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.tabela-materiais th:nth-child(2),
.tabela-materiais td:nth-child(2) {
    width: 100px;
    text-align: center;
}

.tabela-materiais th:nth-child(3),
.tabela-materiais td:nth-child(3) {
    width: 210px;
}

.tabela-materiais td {
    height: 35px;
}

.opcoes-resultado {
    padding: 13px;
    border: 1px solid var(--cor-borda);
    border-radius: 7px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 13px;
}

.opcoes-resultado label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #334155;
    font-size: 12px;
    font-weight: 600;
}

.caixa-opcao {
    width: 15px;
    height: 15px;
    border: 1.5px solid #64748b;
    border-radius: 3px;
    flex-shrink: 0;
}

.dados-finalizacao {
    margin-top: 25px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

.campo-finalizacao span {
    display: block;
    margin-bottom: 25px;
    color: var(--cor-texto-secundario);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

.linha-assinatura {
    border-bottom: 1px solid #64748b;
}

.assinaturas {
    margin-top: 55px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 60px;
}

.assinatura-item {
    text-align: center;
}

.assinatura-item strong {
    display: block;
    margin-top: 8px;
    color: var(--cor-texto);
    font-size: 11px;
}

.assinatura-item small {
    display: block;
    margin-top: 4px;
    color: var(--cor-texto-secundario);
    font-size: 10px;
}

.rodape-ficha {
    margin-top: 30px;
    padding-top: 10px;
    border-top: 1px solid var(--cor-borda);
    display: flex;
    justify-content: space-between;
    gap: 20px;
    color: #94a3b8;
    font-size: 9px;
}

@media screen and (max-width: 700px) {
    body {
        padding: 10px;
    }

    .pagina-a4 {
        min-height: auto;
        padding: 20px;
    }

    .barra-acoes {
        flex-direction: column;
    }

    .botao {
        width: 100%;
    }

    .cabecalho-ficha {
        align-items: flex-start;
        flex-direction: column;
    }

    .cabecalho-ticket {
        width: 100%;
        text-align: left;
    }

    .estado-ticket,
    .grelha-dados,
    .opcoes-resultado,
    .dados-finalizacao,
    .assinaturas {
        grid-template-columns: 1fr;
    }

    .estado-ticket > div {
        padding-bottom: 10px;
        border-right: 0;
        border-bottom: 1px solid #bfdbfe;
    }

    .estado-ticket > div:last-child {
        padding-bottom: 0;
        border-bottom: 0;
    }

    .assinaturas {
        gap: 50px;
    }
}

@page {
    size: A4 portrait;
    margin: 8mm;
}

@media print {
    html,
    body {
        width: 210mm;
        min-height: 297mm;
        margin: 0;
        padding: 0;
        background: #ffffff;
    }

    body {
        font-size: 11px;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }

    .barra-acoes {
        display: none !important;
    }

    .pagina-a4 {
        width: 100%;
        max-width: none;
        min-height: auto;
        margin: 0;
        padding: 6mm;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .cabecalho-ficha {
        padding-bottom: 10px;
    }

    .logotipo-marca {
        width: 48px;
        height: 48px;
        font-size: 17px;
    }

    .cabecalho-ficha h1 {
        font-size: 18px;
    }

    .estado-ticket {
        margin-top: 10px;
        padding: 9px 12px;
    }

    .secao-ficha {
        margin-top: 12px;
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .titulo-secao {
        margin-bottom: 7px;
    }

    .titulo-secao span {
        width: 22px;
        height: 22px;
        font-size: 8px;
    }

    .titulo-secao h2 {
        font-size: 12px;
    }

    .campo {
        min-height: 45px;
        padding: 7px 9px;
    }

    .texto-descricao {
        min-height: 35px;
        line-height: 1.35;
    }

    .area-diagnostico,
    .area-servico {
        min-height: 75px;
    }

    .linha-preenchimento {
        height: 17px;
    }

    .tabela-materiais th,
    .tabela-materiais td {
        padding: 6px;
    }

    .tabela-materiais td {
        height: 26px;
    }

    .area-observacao {
        min-height: 60px;
    }

    .dados-finalizacao {
        margin-top: 17px;
    }

    .assinaturas {
        margin-top: 38px;
    }

    .rodape-ficha {
        margin-top: 18px;
    }

    a {
        color: inherit;
        text-decoration: none;
    }
}
