body.bg-dark {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: radial-gradient(circle at top, #5a0000 0, #000000 55%);
    color: #fff;
}

/* Layout geral */
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(90deg, #5b0000, #2d0000);
    padding: 10px 15px;
    position: sticky;
    top: 0;
    z-index: 30;
}

.mini-logo {
    width: 40px;
    height: 40px;
    background: #990000;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 18px;
    cursor: pointer; /* agora é botão de menu */
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.topbar-user {
    font-size: 14px;
    opacity: 0.8;
}

.sidebar {
    position: fixed;
    top: 60px;
    left: 0;
    bottom: 0;
    width: 230px;
    background: rgba(10, 0, 0, 0.9);
    border-right: 1px solid rgba(255,255,255,0.08);
    padding: 10px;
    box-sizing: border-box;
    z-index: 25;
}

.sidebar-user {
    margin-bottom: 15px;
}

.sidebar-title {
    font-weight: 700;
}

.sidebar-sub {
    font-size: 12px;
    opacity: 0.6;
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-menu li a {
    display: block;
    padding: 8px 10px;
    margin-bottom: 4px;
    border-radius: 4px;
    text-decoration: none;
    color: #f5f5f5;
    font-size: 14px;
}

.sidebar-menu li a:hover {
    background: rgba(255,255,255,0.08);
}

.sidebar-footer {
    position: absolute;
    bottom: 10px;
    left: 10px;
    font-size: 11px;
    opacity: 0.6;
}

.content {
    margin-left: 250px;
    padding: 20px 15px 40px 15px;
}

/* Cards / botões */
.card {
    background: linear-gradient(180deg, rgba(40,0,0,0.9), rgba(5,0,0,0.95));
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 0 15px rgba(0,0,0,0.6);
}

.card-main h2 {
    margin-top: 0;
    margin-bottom: 10px;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    grid-gap: 15px;
    margin-top: 15px;
}

.card-btn {
    text-decoration: none;
    display: block;
    padding: 15px;
    border-radius: 10px;
    color: #fff;
}

.card-btn h3 {
    margin: 0 0 8px 0;
}

.card-btn p {
    margin: 0 0 12px 0;
    font-size: 13px;
}

.card-blue { background: #0b76ff; }
.card-yellow{ background: #ffb400; }
.card-orange{ background: #ff7b00; }
.card-green { background: #0ea560; }
.card-dark  { background: #333333; }

/* Botões */
.btn {
    display: inline-block;
    border-radius: 6px;
    border: none;
    padding: 8px 14px;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
    color: #fff;
}

.btn-block {
    width: 100%;
    text-align: center;
}

.btn-primary { background: #0b76ff; }
.btn-danger  { background: #b30000; }
.btn-success { background: #0ea560; }
.btn-warning { background: #ff8800; }
.btn-light   { background: #ffffff; color:#000; }
.btn-danger-small { background:#b30000; font-size:12px; padding:4px 8px; }

.inline-form { display:inline; }

/* Tabelas */
.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    background: rgba(0,0,0,0.4);
}

.table th,
.table td {
    border-bottom: 1px solid rgba(255,255,255,0.08);
    padding: 8px;
    font-size: 13px;
}

.table th {
    background: rgba(255,255,255,0.05);
}

/* Imagens */
.preview-img {
    max-height: 60px;
}

/* Alerts */
.alert {
    padding: 8px 10px;
    border-radius: 6px;
    font-size: 13px;
    margin-bottom: 10px;
}

.alert-danger { background: rgba(255,0,0,0.2); }
.alert-info   { background: rgba(0,149,255,0.25); }
.alert-success{ background: rgba(0,255,128,0.15); }

/* Formulários */
label {
    display: block;
    margin-top: 10px;
    font-size: 13px;
}
input[type=text],
input[type=password],
input[type=file],
textarea,
select {
    width: 100%;
    box-sizing: border-box;
    padding: 8px;
    margin-top: 4px;
    border-radius: 4px;
    border: 1px solid rgba(255,255,255,0.2);
    background: rgba(0,0,0,0.6);
    color: #fff;
}

textarea {
    resize: vertical;
}

.hint {
    font-size: 12px;
    opacity: 0.7;
}

.hint-center {
    margin-top: 10px;
    text-align: center;
    font-size: 12px;
    opacity: 0.7;
}

/* QR Layout */
.qr-layout {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.qr-column {
    flex: 1 1 260px;
}

.qr-card {
    background: rgba(0,0,0,0.5);
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 15px;
}

.qr-preview {
    width: 100%;
    max-width: 280px;
    background: #fff;
    padding: 10px;
    border-radius: 8px;
}

/* Login page */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.login-card {
    background: linear-gradient(180deg, #5b0000, #050000);
    padding: 20px;
    border-radius: 10px;
    width: 320px;
    box-shadow: 0 0 20px rgba(0,0,0,0.7);
}

.login-card h1 {
    text-align: center;
    margin-top: 0;
    margin-bottom: 15px;
}

/* Responsivo / menu lateral no mobile */
@media (max-width: 800px) {

    .content {
        margin-left: 0;
        padding-top: 75px;
    }

    .sidebar {
        width: 260px;
        transform: translateX(-100%);      /* começa escondida */
        transition: transform 0.25s ease-out;
    }

    body.sidebar-open .sidebar {
        transform: translateX(0);          /* aparece quando clica no UNI */
    }

    /* “cortina” escura por trás quando menu está aberto */
    body.sidebar-open::before {
        content: "";
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.5);
        z-index: 20;
    }
}