* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
    overflow-x: hidden;
}

body {
    font-family: Arial, sans-serif;
    background: #1f2329;
    margin: 0;
    padding: 0;
    color: #f3f4f6;
}

/* Layout base */
.container {
    max-width: 980px;
    min-height: 100svh;
    margin: 0 auto;
    padding: clamp(16px, 3vh, 32px) 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.container.small {
    max-width: 520px;
}

.container.wide {
    max-width: 1180px;
    justify-content: flex-start;
}

.admin-container {
    padding-top: 22px;
}

.card {
    width: 100%;
    background: #2b3038;
    border-radius: 14px;
    padding: clamp(22px, 3vw, 36px);
    color: #f3f4f6;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
}

/* Logo */
.logo-area {
    width: 100%;
    max-width: 980px;
    margin: 0 auto 18px auto;
    padding: 0;
    text-align: left;
}

.container.wide .logo-area {
    max-width: 1180px;
}

.logo-3z {
    max-width: clamp(130px, 14vw, 190px);
    height: auto;
    display: block;
}

.logo-link {
    display: inline-block;
    text-decoration: none;
}

.logo-link:hover {
    opacity: 0.85;
}

/* Oculta marca antiga em texto */
.brand {
    display: none !important;
}

/* Tipografia */
h1 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: clamp(26px, 3vw, 38px);
    line-height: 1.15;
    color: #ffffff;
    letter-spacing: 1px;
}

h2 {
    margin-top: 30px;
    font-size: clamp(20px, 2vw, 26px);
    color: #ffffff;
}

h3,
label,
strong {
    color: #ffffff;
}

p,
li {
    font-size: clamp(15px, 1.4vw, 18px);
    line-height: 1.55;
    color: #d1d5db;
}

p {
    margin-top: 0;
    margin-bottom: 16px;
}

small,
.muted {
    color: #9ca3af;
    font-size: 14px;
}

code {
    background: #111827;
    color: #fec900;
    padding: 5px 8px;
    border-radius: 7px;
    font-weight: bold;
}

/* Botões */
.buttons {
    margin-top: 22px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    cursor: pointer;
    padding: 13px 22px;
    min-height: 48px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
    background: #fec900;
    color: #111111;
    font-size: 15px;
}

.button.secondary {
    background: #111827;
    color: #ffffff;
    border: 1px solid #4b5563;
}

.button.small {
    padding: 8px 12px;
    min-height: 36px;
    font-size: 13px;
}

.back {
    color: #fec900;
    text-decoration: none;
    font-weight: bold;
    display: inline-block;
    margin-bottom: 18px;
}

/* Alertas */
.notice {
    margin-top: 22px;
    padding: 14px 16px;
    background: #3a3320;
    border-left: 4px solid #fec900;
    border-radius: 8px;
    font-size: 15px;
    line-height: 1.4;
    color: #fef3c7;
}

.alert {
    padding: 14px;
    margin: 18px 0;
    border-radius: 8px;
}

.alert.error {
    background: #4b1d1d;
    color: #fecaca;
}

.alert.success {
    background: #16351f;
    color: #bbf7d0;
}

/* Formulários */
.form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 18px;
}

.form.inline {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
}

.form.inline select {
    max-width: 260px;
}

.form.inline input[type="text"] {
    flex: 1;
    min-width: 240px;
}

.compact-form {
    margin-bottom: 18px;
}

.search-row {
    display: flex;
    gap: 10px;
}

.search-row input {
    flex: 1;
}

input[type="text"],
input[type="password"],
input[type="file"],
textarea,
select {
    width: 100%;
    padding: 13px;
    border: 1px solid #4b5563;
    border-radius: 8px;
    font-size: 15px;
    background: #1f2329;
    color: #ffffff;
}

input::placeholder,
textarea::placeholder {
    color: #9ca3af;
}

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

select {
    appearance: auto;
}

/* Dados e status */
.code-box {
    font-size: clamp(20px, 3vw, 28px);
    letter-spacing: 1px;
    font-weight: bold;
    text-align: center;
    background: #111827;
    color: #fec900;
    border: 1px solid #374151;
    border-radius: 12px;
    padding: 24px;
    margin: 24px 0;
    word-break: break-word;
}

.status {
    display: inline-block;
    background: #374151;
    color: #ffffff;
    border-radius: 999px;
    padding: 8px 14px;
    font-weight: bold;
}

.small-status {
    padding: 5px 10px;
    font-size: 13px;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin: 20px 0;
}

.summary-grid > div {
    background: #1f2329;
    border: 1px solid #4b5563;
    border-radius: 10px;
    padding: 14px;
}

.label-mini {
    display: block;
    font-size: 12px;
    color: #9ca3af;
    margin-bottom: 7px;
    text-transform: uppercase;
    letter-spacing: .5px;
}

.box-text {
    background: #1f2329;
    color: #f3f4f6;
    border: 1px solid #4b5563;
    border-radius: 10px;
    padding: 18px;
    line-height: 1.6;
    white-space: normal;
}

/* Chat */
.chat {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 10px;
}

.chat-message {
    display: flex;
    flex-direction: column;
    max-width: 82%;
}

.chat-user {
    align-self: flex-start;
}

.chat-admin {
    align-self: flex-end;
}

.chat-meta {
    font-size: 12px;
    color: #9ca3af;
    margin-bottom: 5px;
}

.chat-bubble {
    background: #1f2329;
    color: #f3f4f6;
    border: 1px solid #4b5563;
    border-radius: 14px;
    padding: 14px 16px;
    line-height: 1.55;
}

.chat-admin .chat-bubble {
    background: #3a3320;
    border-color: #fec900;
    color: #fef3c7;
}

.chat-title {
    font-weight: bold;
    color: #fec900;
    margin-bottom: 8px;
}

/* Timeline antigo mantido */
.timeline {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.timeline-item {
    border: 1px solid #4b5563;
    border-radius: 10px;
    padding: 14px;
    background: #1f2329;
    color: #f3f4f6;
}

.timeline-item span {
    display: block;
    color: #9ca3af;
    font-size: 13px;
    margin-top: 4px;
}

/* Tabelas */
.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 18px;
    background: #2b3038;
    color: #f3f4f6;
}

th,
td {
    padding: 12px;
    border-bottom: 1px solid #4b5563;
    text-align: left;
    color: #e5e7eb;
    vertical-align: middle;
}

th {
    background: #111827;
    color: #ffffff;
}

.admin-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.filters {
    display: flex;
    align-items: end;
    gap: 10px;
    flex-wrap: wrap;
    margin: 20px 0;
}

.filters > div {
    min-width: 220px;
}

/* Arquivos */
.file-list {
    padding-left: 20px;
}

.file-list.no-margin {
    margin: 0;
}

.file-list a {
    color: #fec900;
}

.file-list span {
    color: #9ca3af;
    font-size: 13px;
    margin-left: 8px;
}

.checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: normal;
}

hr {
    border: 0;
    border-top: 1px solid #4b5563;
    margin: 26px 0;
}

/* Notebook/telas menores em altura */
@media (max-height: 760px) and (min-width: 768px) {
    .container {
        justify-content: flex-start;
        padding-top: 18px;
        padding-bottom: 18px;
    }

    .logo-area {
        margin-bottom: 12px;
    }

    .logo-3z {
        max-width: 140px;
    }

    .card {
        padding: 24px 32px;
    }

    h1 {
        font-size: 30px;
        margin-bottom: 16px;
    }

    p {
        font-size: 16px;
        margin-bottom: 12px;
    }

    .notice {
        margin-top: 16px;
    }
}

/* Tablet */
@media (max-width: 900px) {
    .summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .chat-message {
        max-width: 94%;
    }
}

/* Celular */
@media (max-width: 700px) {
    .container {
        justify-content: flex-start;
        padding: 18px 14px;
    }

    .logo-area {
        margin-bottom: 14px;
    }

    .logo-3z {
        max-width: 135px;
    }

    .card {
        padding: 22px 18px;
        border-radius: 12px;
    }

    h1 {
        font-size: 26px;
    }

    p,
    li {
        font-size: 15px;
    }

    .buttons,
    .search-row {
        flex-direction: column;
        width: 100%;
    }

    .button {
        width: 100%;
    }

    .code-box {
        font-size: 20px;
        padding: 18px;
    }

    .summary-grid {
        grid-template-columns: 1fr;
    }

    .chat-message {
        max-width: 100%;
    }

    .chat-admin {
        align-self: flex-start;
    }

    .admin-top {
        flex-direction: column;
        align-items: flex-start;
    }

    .form.inline {
        flex-direction: column;
        align-items: stretch;
    }

    .form.inline select,
    .form.inline input[type="text"] {
        max-width: none;
        min-width: 0;
    }
}
