:root {
    --bg: #eef1f5;
    --surface: #ffffff;
    --surface-muted: #f7f8fa;
    --text: #1f2937;
    --muted: #667085;
    --line: #d8dde6;
    --primary: #174b7a;
    --primary-strong: #12385d;
    --danger: #a61b1b;
    --ok: #d9f7d2;
    --warn: #fff1b8;
    --bad: #ffd6d6;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    color: var(--text);
    background: var(--bg);
}

.app-header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    padding: 14px 24px;
    color: #fff;
    background: var(--primary);
}

.app-header strong {
    display: block;
    font-size: 20px;
}

.app-header span,
.operator {
    font-size: 14px;
    opacity: .92;
}

.topmenu {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 24px;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}

.topmenu a,
button,
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 7px 12px;
    border: 0;
    border-radius: 6px;
    color: #fff;
    background: #596579;
    text-decoration: none;
    cursor: pointer;
    font-size: 14px;
}

.topmenu a.active,
button.primary,
.button.primary {
    background: var(--primary);
}

.topmenu a.danger,
button.danger,
.button.danger {
    background: var(--danger);
}

.container {
    width: min(1120px, calc(100% - 32px));
    margin: 20px auto;
    padding: 22px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 20px;
}

.login-box {
    width: min(360px, 100%);
    padding: 28px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(31, 41, 55, .08);
}

h1, h2, h3 {
    margin: 18px 0 10px;
}

h1 { font-size: 24px; }
h2 { font-size: 20px; }
h3 { font-size: 17px; }

label {
    display: block;
    margin-top: 8px;
    font-weight: 700;
    font-size: 14px;
}

input,
select,
textarea {
    width: 100%;
    margin: 5px 0 10px;
    padding: 8px;
    border: 1px solid #c6ccd6;
    border-radius: 6px;
    background: #fff;
    font-size: 14px;
}

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

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

.full { grid-column: 1 / -1; }

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

.panel {
    margin: 16px 0;
    padding: 14px;
    background: var(--surface-muted);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
    margin-top: 10px;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

th,
td {
    padding: 8px;
    border: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

th {
    background: #edf2f7;
}

.status-disponivel td { background: var(--ok); }
.status-restricao td { background: var(--warn); }
.status-indisponivel td { background: var(--bad); }

.alert {
    padding: 10px 12px;
    margin-bottom: 12px;
    border-radius: 6px;
    border: 1px solid var(--line);
    background: #eef6ff;
}

.alert-success { background: #e7f8ec; border-color: #b6e6c4; }
.alert-error { background: #fff0f0; border-color: #f2b3b3; }
.alert-warning { background: #fff7dc; border-color: #ead78a; }

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

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

.checkbox-list input {
    width: auto;
    margin: 0;
}

.qr-block {
    display: flex;
    gap: 18px;
    align-items: center;
    flex-wrap: wrap;
}

.qr-block img {
    width: 180px;
    height: 180px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
}

@media (max-width: 720px) {
    .app-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .container {
        width: calc(100% - 20px);
        padding: 14px;
    }

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

    .topmenu {
        padding: 10px;
    }
}

@media print {
    body { background: #fff; }
    .no-print,
    .topmenu,
    .app-header,
    button,
    .button { display: none !important; }
    .container {
        width: 100%;
        margin: 0;
        padding: 0;
        border: 0;
    }
    th, td {
        font-size: 12px;
        padding: 5px;
    }
}
