* {
    box-sizing: border-box;
}

:root {
    --gold: #b88938;
    --gold-dark: #8b672c;
    --black: #151515;
    --muted: #777;
    --bg: #f5f2ec;
    --card: #ffffff;
    --border: #e7dece;
    --danger: #b42318;
    --success: #16794c;
}

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

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

.app {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 250px;
    background: #151515;
    color: #fff;
    padding: 22px 18px;
    position: fixed;
    inset: 0 auto 0 0;
}

.brand {
    text-align: center;
    margin-bottom: 26px;
    border-bottom: 1px solid rgba(184,137,56,.35);
    padding-bottom: 18px;
}

.brand img {
    max-width: 160px;
    max-height: 95px;
    object-fit: contain;
    display: block;
    margin: 0 auto 10px;
    background: #050505;
    border-radius: 14px;
    padding: 8px;
}

.current-logo-panel {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 0 0 12px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #faf8f4;
}

.current-logo-preview {
    width: 240px;
    height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    border: 1px solid #ddd4c6;
    border-radius: 10px;
    background: #fff;
}

.current-logo-preview img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.current-logo-panel strong,
.current-logo-panel small {
    display: block;
}

.current-logo-panel small {
    margin-top: 5px;
    color: var(--muted);
}

.current-logo-empty {
    margin: 0 0 12px;
    padding: 11px 12px;
    border: 1px dashed #cfbea3;
    border-radius: 10px;
    background: #fffaf1;
    color: #6b5838;
    font-size: 13px;
}

body.logo-editor-open {
    overflow: hidden;
}

.logo-editor-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    padding: 24px;
    background: rgba(0, 0, 0, .72);
    overflow: auto;
}

.logo-editor-modal:not([hidden]) {
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-editor-dialog {
    width: min(960px, 100%);
    padding: 22px;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 24px 80px rgba(0, 0, 0, .38);
}

.logo-editor-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 16px;
}

.logo-editor-heading h2,
.logo-editor-heading p {
    margin: 0;
}

.logo-editor-heading p {
    margin-top: 6px;
    color: var(--muted);
}

.logo-editor-close {
    border: 0;
    background: transparent;
    color: #555;
    cursor: pointer;
    font-size: 32px;
    line-height: 1;
}

.logo-editor-canvas-wrap {
    overflow: hidden;
    border: 3px solid var(--gold);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, .04) inset;
}

#logoEditorCanvas {
    display: block;
    width: 100%;
    aspect-ratio: 3 / 1;
    cursor: grab;
    touch-action: none;
}

#logoEditorCanvas:active {
    cursor: grabbing;
}

.logo-editor-controls {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 14px;
    margin-top: 18px;
}

.logo-editor-controls label {
    margin: 0;
}

.logo-editor-controls input[type="range"] {
    padding: 0;
}

.logo-editor-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 18px;
}

.logo-editor-error {
    margin-top: 14px;
    padding: 10px 12px;
    border: 1px solid #efb4ae;
    border-radius: 10px;
    background: #fff0ef;
    color: var(--danger);
}

@media (max-width: 700px) {
    .current-logo-panel {
        align-items: stretch;
        flex-direction: column;
    }

    .current-logo-preview {
        width: 100%;
    }

    .logo-editor-modal {
        padding: 10px;
    }

    .logo-editor-dialog {
        padding: 16px;
    }

    .logo-editor-actions .btn {
        flex: 1;
    }
}

.brand span {
    color: #d8bd7c;
    font-size: 13px;
    letter-spacing: .5px;
}

.sidebar nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar nav a {
    padding: 12px 13px;
    border-radius: 10px;
    color: #eee;
    font-size: 15px;
    transition: .2s;
}

.sidebar nav a:hover {
    background: rgba(184,137,56,.2);
    color: #fff;
}

.sidebar nav .logout {
    margin-top: 14px;
    color: #ffb4a8;
}

.main {
    margin-left: 250px;
    width: calc(100% - 250px);
}

.topbar {
    background: #fff;
    padding: 18px 26px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.content {
    padding: 26px;
}

.page-title {
    margin: 0 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.page-title h1 {
    margin: 0;
    font-size: 26px;
}

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 8px 20px rgba(50,35,10,.04);
    margin-bottom: 18px;
}

.grid {
    display: grid;
    gap: 18px;
}

.grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.metric {
    padding: 20px;
    border-radius: 16px;
    background: #fff;
    border: 1px solid var(--border);
}

.metric small {
    color: var(--muted);
    display: block;
    margin-bottom: 8px;
}

.metric strong {
    font-size: 25px;
    color: var(--gold-dark);
}

.btn {
    display: inline-block;
    border: none;
    border-radius: 10px;
    background: var(--gold);
    color: #fff;
    padding: 10px 14px;
    cursor: pointer;
    font-weight: bold;
    font-size: 14px;
}

.btn:hover {
    background: var(--gold-dark);
}

.btn.secondary {
    background: #252525;
}

.btn.danger {
    background: var(--danger);
}

.btn.light {
    background: #f1eadc;
    color: #5b421d;
}

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

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

label {
    display: block;
    font-size: 13px;
    color: #4b4b4b;
    margin-bottom: 6px;
    font-weight: bold;
}

input, select, textarea {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid #d9d0c0;
    border-radius: 10px;
    font-size: 15px;
    background: #fff;
}

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

.actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.table-wrap {
    overflow-x: auto;
}

table {
    border-collapse: collapse;
    width: 100%;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
}

th, td {
    padding: 12px;
    border-bottom: 1px solid #eee7dc;
    text-align: left;
    font-size: 14px;
    vertical-align: top;
}

th {
    background: #fbf7ef;
    color: #4a3515;
}

tr:hover td {
    background: #fffdf9;
}

.badge {
    display: inline-block;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: bold;
}

.badge.ok {
    background: #e7f7ef;
    color: var(--success);
}

.badge.low {
    background: #fff0e8;
    color: #a84a00;
}

.badge.zero {
    background: #ffe8e8;
    color: var(--danger);
}

.alert {
    padding: 12px 14px;
    border-radius: 12px;
    margin-bottom: 18px;
}

.alert.success {
    background: #e7f7ef;
    color: var(--success);
    border: 1px solid #bce6ce;
}

.alert.error {
    background: #ffe8e8;
    color: var(--danger);
    border: 1px solid #ffc9c9;
}

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: radial-gradient(circle at top, #fff 0, #f5f2ec 55%, #e7dece 100%);
}

.login-card {
    width: 420px;
    max-width: 92vw;
    background: #fff;
    padding: 34px;
    border-radius: 22px;
    box-shadow: 0 20px 55px rgba(0,0,0,.12);
    border: 1px solid var(--border);
}

.login-card img {
    max-width: 100%;
    display: block;
    margin: 0 auto;
}

.official-logo {
    width: 100%;
    max-width: 340px;
    margin: 0 auto 20px;
    background: #000;
    border-radius: 14px;
    overflow: hidden;
}

.official-logo img {
    width: 100%;
    height: auto;
}

.first-access-card {
    width: 500px;
}

.login-card h1 {
    text-align: center;
    margin: 0 0 8px;
}

.login-card p {
    text-align: center;
    color: var(--muted);
    margin-bottom: 22px;
}

.login-card .btn {
    width: 100%;
    padding: 13px;
    margin-top: 10px;
}

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

.search-row input {
    max-width: 360px;
}

.print-body {
    background: #fff;
    padding: 30px;
}

.print-page {
    max-width: 850px;
    margin: 0 auto;
    border: 1px solid #e2d6c2;
    padding: 28px;
}

.print-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 2px solid var(--gold);
    padding-bottom: 18px;
    margin-bottom: 20px;
}

.print-header img {
    max-width: 170px;
    max-height: 95px;
    object-fit: contain;
}

.print-title {
    text-align: right;
}

.print-title h1 {
    margin: 0;
    color: var(--gold-dark);
}

.print-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    margin-bottom: 20px;
}

.print-footer {
    margin-top: 34px;
    color: #666;
    font-size: 13px;
    border-top: 1px solid #eee;
    padding-top: 14px;
}

.no-print {
    margin: 20px auto;
    max-width: 850px;
}

@media print {
    .no-print {
        display: none;
    }
    .print-body {
        padding: 0;
    }
    .print-page {
        border: none;
        max-width: none;
    }
}

@media (max-width: 900px) {
    .sidebar {
        position: static;
        width: 100%;
    }
    .app {
        flex-direction: column;
    }
    .main {
        margin-left: 0;
        width: 100%;
    }
    .grid-4, .grid-3, .form-grid {
        grid-template-columns: 1fr;
    }
    .topbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}


/* MENU LATERAL COM SCROLL - CLICK FORGE */
aside, .sidebar, .side-menu, .menu-lateral {
    max-height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
}
aside::-webkit-scrollbar, .sidebar::-webkit-scrollbar, .side-menu::-webkit-scrollbar, .menu-lateral::-webkit-scrollbar {
    width: 6px;
}
aside::-webkit-scrollbar-thumb, .sidebar::-webkit-scrollbar-thumb, .side-menu::-webkit-scrollbar-thumb, .menu-lateral::-webkit-scrollbar-thumb {
    background: rgba(189, 141, 53, .55);
    border-radius: 20px;
}
aside nav, .sidebar nav, .side-menu nav, .menu-lateral nav {
    padding-bottom: 28px;
}

/* ATUALIZAÇÕES ASSINADAS - CLICK FORGE */
.update-nav-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.update-nav-badge {
    padding: 3px 6px;
    border-radius: 999px;
    background: #e9b949;
    color: #151515;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .4px;
}

.update-global-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    padding: 15px 17px;
    margin-bottom: 20px;
    border: 1px solid #d9b56f;
    border-radius: 14px;
    background: linear-gradient(100deg, #fff8e9, #fffdf8);
    box-shadow: 0 8px 22px rgba(139, 103, 44, .08);
}

.update-global-banner strong,
.update-global-banner span {
    display: block;
}

.update-global-banner span {
    margin-top: 3px;
    color: #66563b;
    font-size: 14px;
}

.update-subtitle {
    margin: 5px 0 0;
    color: var(--muted);
}

.update-version-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-bottom: 18px;
}

.update-metric-text {
    font-size: 19px !important;
}

.update-release-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 16px;
}

.update-release-heading h2 {
    margin: 12px 0 0;
}

.update-release-meta {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.55;
    text-align: right;
}

.update-notes {
    padding: 18px 0;
    line-height: 1.6;
    color: #3d3529;
}

.update-safety {
    padding: 13px 15px;
    margin-bottom: 16px;
    border-radius: 12px;
    background: #f7f3eb;
    color: #594a34;
    font-size: 14px;
    line-height: 1.5;
}

.update-primary-button {
    min-width: 170px;
    padding: 13px 18px;
}

.update-primary-button:disabled {
    opacity: .7;
    cursor: wait;
}

.update-current-card,
.update-installing {
    display: flex;
    align-items: center;
    gap: 18px;
}

.update-current-card h2,
.update-installing h2 {
    margin: 0 0 6px;
}

.update-current-card p,
.update-installing p {
    margin: 5px 0;
    color: #5c554a;
}

.update-checkmark {
    display: grid;
    place-items: center;
    flex: 0 0 52px;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #e7f7ef;
    color: var(--success);
    font-size: 28px;
    font-weight: bold;
}

.update-spinner {
    flex: 0 0 46px;
    width: 46px;
    height: 46px;
    border: 4px solid #eadfc9;
    border-top-color: var(--gold);
    border-radius: 50%;
    animation: emerim-update-spin .9s linear infinite;
}

@keyframes emerim-update-spin {
    to { transform: rotate(360deg); }
}

.update-check-form {
    margin-top: 4px;
}

.update-details {
    margin-top: 14px;
}

.update-details summary {
    cursor: pointer;
    color: var(--gold-dark);
    font-weight: bold;
}

.update-details pre {
    white-space: pre-wrap;
    padding: 12px;
    border-radius: 10px;
    background: #f7f3eb;
    color: #5d4f3b;
}

@media (max-width: 900px) {
    .update-version-grid {
        grid-template-columns: 1fr;
    }
    .update-global-banner,
    .update-release-heading {
        align-items: flex-start;
        flex-direction: column;
    }
    .update-release-meta {
        text-align: left;
    }
}

.web-trial{background:#edf6ff;padding:12px;border-radius:8px;color:#164474}.web-action{display:inline}.web-action button{font:inherit;cursor:pointer;border:0;background:transparent;color:inherit;text-decoration:underline}.web-auth{max-width:460px;margin:5vh auto;padding:28px;background:white;border-radius:16px}.web-auth input{display:block;width:100%;box-sizing:border-box;padding:12px;margin:8px 0 18px}.web-auth label{display:block}.web-auth .btn{width:100%}.web-auth p{line-height:1.5}@media(max-width:800px){.app{display:block}.sidebar{position:relative!important;width:auto!important;height:auto!important}.sidebar nav{display:flex;gap:5px;flex-wrap:wrap}.sidebar nav a{font-size:13px}.main{margin-left:0!important;width:100%!important;padding:12px!important}.topbar{gap:12px;flex-wrap:wrap}.content{padding:8px!important}.table-wrap{overflow-x:auto}table{display:block;overflow-x:auto}.web-auth{margin:24px 12px}}

.web-auth>img{background:#171717;border-radius:10px;padding:10px;box-sizing:border-box}

.forge-password{display:block;position:relative;margin:8px 0 18px}.forge-password input{width:100%;box-sizing:border-box;margin:0!important;padding-right:48px!important}.forge-password-eye{position:absolute;right:5px;top:50%;transform:translateY(-50%);width:36px;height:32px;display:grid;place-items:center;padding:0!important;margin:0!important;border:0!important;border-radius:6px;background:transparent!important;color:#6a5330;cursor:pointer}.forge-password-eye:hover{background:#eee8df!important}.forge-password-eye:focus-visible{outline:2px solid #1458e6;outline-offset:1px}.forge-password-eye .eye-slash{display:none}.forge-password-eye.is-visible .eye-slash{display:block}
