:root {
    --bg: #eef2f7;
    --card: #ffffff;
    --ink: #0f172a;
    --muted: #64748b;
    --line: #dbe3ee;
    --primary: #15803d;
    --ok: #047857;
    --warn: #b45309;
    --bad: #b91c1c;
}

* { box-sizing: border-box; }

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

.topbar {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    padding: 18px 24px;
    background: #14532d;
    color: white;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-emblem {
    width: 48px;
    height: 54px;
    object-fit: contain;
    background: white;
    border-radius: 4px;
    padding: 2px;
}

.brand-logo {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: white;
    object-fit: contain;
}

.topbar h1 {
    margin: 0;
    font-size: 22px;
}

.topbar p {
    margin: 4px 0 0;
    color: #cbd5e1;
    font-size: 13px;
}

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

.auth-gate {
    max-width: 520px;
    margin: 48px auto;
    padding: 28px 24px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    text-align: center;
    font-weight: 700;
}

.auth-gate .muted {
    font-weight: 400;
    margin-top: 8px;
}

.auth-gate h2 {
    margin: 0 0 8px;
}

.auth-gate a {
    display: inline-block;
    margin-top: 16px;
    color: var(--primary);
    font-weight: 700;
}

.login-form {
    display: grid;
    gap: 12px;
    text-align: left;
    margin-top: 18px;
}

.login-error {
    color: var(--bad);
    font-size: 13px;
    margin: 0;
}

.layout {
    max-width: 980px;
    margin: 24px auto;
    padding: 0 16px 40px;
    display: grid;
    gap: 16px;
}

.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 18px;
}

.tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.tab, .btn {
    border: 0;
    border-radius: 6px;
    padding: 10px 16px;
    cursor: pointer;
    font-size: 14px;
}

.tab {
    background: #e2e8f0;
    color: #334155;
}

.tab.active {
    background: var(--primary);
    color: white;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn:disabled,
.tab:disabled {
    opacity: 0.6;
    cursor: wait;
}

.btn-ghost {
    background: transparent;
    color: white;
    text-decoration: none;
    border: 1px solid #94a3b8;
    display: inline-flex;
    align-items: center;
}

.pill {
    font-size: 12px;
    padding: 6px 10px;
    border-radius: 999px;
    font-weight: 700;
}

.pill-online { background: #d1fae5; color: var(--ok); }
.pill-offline { background: #fee2e2; color: var(--bad); }
.pill-pending { background: #ffedd5; color: var(--warn); }

.hidden { display: none !important; }

.grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}

label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13px;
    font-weight: 700;
}

input, select, textarea {
    font: inherit;
    padding: 10px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
}

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

.muted { color: var(--muted); font-size: 13px; }

.table-wrap {
    overflow-x: auto;
    margin-top: 12px;
}

.records {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

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

.records th {
    font-size: 12px;
    color: var(--muted);
    border-top: 0;
}

.btn-print {
    background: var(--primary);
    color: white;
    padding: 6px 12px;
    font-size: 13px;
}

.status-wait { color: var(--warn); font-weight: 700; }
.status-ok { color: var(--ok); font-weight: 700; }

#voucher-frame {
    position: absolute;
    width: 0;
    height: 0;
    border: 0;
    visibility: hidden;
}

.banner {
    margin: 12px 16px 0;
    padding: 12px 16px;
    border-radius: 8px;
    font-weight: 700;
}

.banner.ok { background: #d1fae5; color: var(--ok); }
.banner.warn { background: #ffedd5; color: var(--warn); }
.banner.bad { background: #fee2e2; color: var(--bad); }

.site-footer {
    text-align: center;
    color: #64748b;
    font-size: 12px;
    padding: 16px;
}

@media (max-width: 720px) {
    .topbar, .grid { display: block; }
    .topbar-actions { margin-top: 12px; }
}
