:root {
    --blue-950: #041a40;
    --blue-900: #07285f;
    --blue-800: #0a3a82;
    --blue-600: #1264c4;
    --green: #43d600;
    --green-dark: #239b00;
    --white: #ffffff;
    --background: #f3f6fa;
    --text: #172033;
    --muted: #687386;
    --border: #e2e8f0;
    --danger: #c62828;
    --radius: 14px;
    --shadow: 0 18px 50px rgba(8, 32, 72, .12);
}

/* v0.3.1 - navegação, identidade visual e atualizações */
:root {
    --brand-primary: #07285f;
    --brand-accent: #55ef22;
}

.sidebar,
.welcome { background-color: var(--brand-primary); }
.nav-item.active { border-left-color: var(--brand-accent); }
.brand-icon { background-color: var(--brand-accent); }
.brand-icon.has-image {
    background-color: transparent;
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
    border-radius: 0;
}
.master-only.hidden { display: none !important; }
.page-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 22px;
}
.page-heading h1 { margin: 4px 0 6px; font-size: 28px; }
.page-heading p { margin: 0; color: var(--muted); }
.eyebrow { color: var(--blue-600); font-size: 12px; font-weight: 800; letter-spacing: .12em; }
.status-pill,
.version-badge {
    padding: 10px 14px;
    border-radius: 999px;
    background: #e8eef7;
    color: var(--blue-900);
    font-size: 13px;
    font-weight: 750;
    white-space: nowrap;
}
.status-pill.online { background: #eafbe5; color: #167900; }
.page-message { padding: 13px 15px; margin-bottom: 18px; border: 1px solid #b9e7ad; border-radius: 10px; background: #effceb; color: #1c680c; }
.page-message.error { border-color: #f0b9b9; background: #fff0f0; color: #a51c1c; }
.settings-layout { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(280px, .55fr); gap: 18px; margin-bottom: 18px; }
.form-panel label,
.upload-card { color: #34445e; font-size: 13px; font-weight: 650; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
.form-panel input,
.upload-card input {
    display: block;
    width: 100%;
    margin-top: 7px;
    padding: 11px 12px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: #fff;
    color: var(--text);
}
.form-panel input[type="color"] { height: 44px; padding: 4px; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.primary-button.compact,
.secondary-button { width: auto; min-height: 40px; padding: 9px 15px; border-radius: 9px; }
.secondary-button { border: 1px solid #cfdae8; background: #fff; color: var(--blue-900); font-weight: 700; }
.secondary-button:hover { background: #f3f7fc; }
.brand-preview {
    min-height: 260px;
    padding: 26px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    border-radius: 12px;
    background: linear-gradient(145deg, var(--brand-primary), #0d3978);
    color: #fff;
}
.preview-logo { width: 92px; height: 92px; display: grid; place-items: center; margin-bottom: 14px; border-radius: 22px; background: var(--brand-accent); color: #07285f; font-size: 38px; font-weight: 900; overflow: hidden; }
.preview-logo img { display: none; max-width: 100%; max-height: 100%; object-fit: contain; }
.preview-logo img.visible { display: block; }
.preview-logo img.visible + span,
.preview-logo:has(img.visible) span { display: none; }
.brand-preview h2 { margin: 0 0 8px; }
.brand-preview p { margin: 0 0 28px; opacity: .82; }
.brand-preview small { opacity: .65; }
.asset-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.upload-card h3 { margin: 0 0 7px; color: var(--text); }
.upload-card p { min-height: 34px; margin: 0 0 12px; color: var(--muted); font-weight: 400; }
.upload-card button { margin-top: 12px; }
.update-grid { display: grid; grid-template-columns: 1.35fr .65fr; gap: 18px; margin-bottom: 18px; }
.check-list { margin: 0; padding: 0; list-style: none; }
.check-list li { position: relative; padding: 10px 0 10px 28px; border-bottom: 1px solid var(--border); color: #41506a; }
.check-list li::before { content: "✓"; position: absolute; left: 0; color: var(--green-dark); font-weight: 900; }
.check-list li:last-child { border-bottom: 0; }
.progress-wrap { margin-top: 16px; }
.progress-track { height: 9px; overflow: hidden; border-radius: 999px; background: #e6edf6; }
.progress-track.large { height: 13px; }
.progress-bar { width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--blue-600), var(--brand-accent)); transition: width .3s ease; }
.progress-wrap span { display: block; margin-top: 7px; color: var(--muted); font-size: 12px; }
.actions-header { display: flex; justify-content: space-between; align-items: center; gap: 15px; }
.release-list { display: grid; gap: 10px; }
.release-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 15px; border: 1px solid var(--border); border-radius: 11px; background: #fbfdff; }
.release-info { min-width: 0; }
.release-info > div { display: flex; align-items: center; gap: 9px; }
.release-info p { margin: 6px 0; color: #4c5970; }
.release-info small { color: var(--muted); }
.release-status { padding: 4px 8px; border-radius: 999px; background: #edf1f6; font-size: 11px; font-weight: 800; text-transform: uppercase; }
.status-installed,
.status-completed,
.status-instalada { background: #e6f9e0; color: #22730e; }
.status-failed { background: #ffe5e5; color: #a81919; }
.skeleton-row { height: 78px; border-radius: 11px; background: linear-gradient(90deg, #eef2f7 25%, #f8fafc 50%, #eef2f7 75%); background-size: 200% 100%; animation: skeleton 1.4s infinite; }
@keyframes skeleton { to { background-position: -200% 0; } }
.empty-inline,
.empty-state { padding: 34px; text-align: center; color: var(--muted); }
.empty-icon { margin-bottom: 10px; color: var(--blue-600); font-size: 34px; }
.empty-state h3 { margin: 0 0 8px; color: var(--text); }
.job-panel { margin-top: 18px; }
.event-list { display: grid; gap: 7px; margin-top: 15px; }
.event-list div { display: grid; grid-template-columns: 110px 1fr; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.event-list span { color: var(--blue-600); font-size: 12px; font-weight: 800; text-transform: uppercase; }
.event-list p { margin: 0; color: #43506a; }
.error-text { color: var(--danger); }

@media (max-width: 1100px) {
    .asset-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 820px) {
    .settings-layout,
    .update-grid { grid-template-columns: 1fr; }
    .page-heading { align-items: flex-start; flex-direction: column; }
    .asset-grid { grid-template-columns: 1fr; }
    .form-grid { grid-template-columns: 1fr; }
    .form-grid .full { grid-column: auto; }
    .release-row { align-items: flex-start; flex-direction: column; }
    .release-row button { width: 100%; }
}

* {
    box-sizing: border-box;
}

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

button,
input {
    font: inherit;
}

button {
    cursor: pointer;
}

.hidden {
    display: none !important;
}

.loading {
    min-height: 100vh;
    display: grid;
    place-content: center;
    justify-items: center;
    background: var(--blue-950);
    color: white;
}

.spinner {
    width: 42px;
    height: 42px;
    border: 4px solid rgba(255,255,255,.2);
    border-top-color: var(--green);
    border-radius: 50%;
    animation: spin .8s linear infinite;
}

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

.login-page {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.05fr .95fr;
}

.login-brand {
    display: grid;
    place-items: center;
    padding: 50px;
    color: white;
    background:
        radial-gradient(circle at 15% 20%, rgba(67,214,0,.2), transparent 32%),
        linear-gradient(145deg, var(--blue-950), var(--blue-800));
}

.brand-content {
    width: min(100%, 530px);
}

.brand-icon {
    width: 90px;
    height: 90px;
    display: grid;
    place-items: center;
    border-radius: 28px;
    font-size: 48px;
    font-weight: 900;
    color: var(--blue-950);
    background: linear-gradient(145deg, #76ff3d, var(--green));
    box-shadow: 0 18px 45px rgba(67,214,0,.28);
}

.brand-icon.small {
    width: 48px;
    height: 48px;
    border-radius: 15px;
    font-size: 25px;
}

.brand-icon.tiny {
    width: 44px;
    height: 44px;
    border-radius: 13px;
    font-size: 23px;
}

.brand-content h1 {
    margin: 28px 0 10px;
    font-size: clamp(42px, 6vw, 68px);
    line-height: 1;
}

.brand-content > p {
    margin: 0;
    font-size: 20px;
    color: #c9dcff;
}

.benefits {
    margin: 42px 0 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 18px;
}

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

.benefits li::before {
    content: "✓";
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    font-weight: bold;
    color: var(--blue-950);
    background: var(--green);
}

.login-area {
    display: grid;
    place-items: center;
    padding: 40px 24px;
    background: white;
}

.login-card {
    width: min(100%, 430px);
}

.mobile-brand {
    display: none;
    align-items: center;
    gap: 12px;
    margin-bottom: 35px;
    color: var(--blue-900);
    font-size: 22px;
}

.tag {
    display: inline-block;
    padding: 7px 11px;
    border-radius: 8px;
    color: var(--green-dark);
    background: #ecffe4;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .12em;
}

.login-card h2 {
    margin: 18px 0 8px;
    color: var(--blue-950);
    font-size: 34px;
}

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

.login-card label {
    display: block;
    margin: 18px 0 8px;
    font-size: 14px;
    font-weight: 700;
}

.login-card input {
    width: 100%;
    height: 52px;
    padding: 0 15px;
    border: 1px solid var(--border);
    border-radius: 10px;
    outline: none;
    transition: .2s;
}

.login-card input:focus {
    border-color: var(--blue-600);
    box-shadow: 0 0 0 4px rgba(18,100,196,.1);
}

.password-field {
    position: relative;
}

.password-field input {
    padding-right: 85px;
}

.password-field button {
    position: absolute;
    right: 10px;
    top: 9px;
    height: 34px;
    border: 0;
    color: var(--blue-600);
    background: transparent;
    font-size: 13px;
    font-weight: 700;
}

.primary-button {
    width: 100%;
    height: 52px;
    margin-top: 25px;
    border: 0;
    border-radius: 10px;
    color: white;
    background: linear-gradient(135deg, var(--blue-800), var(--blue-600));
    font-weight: 800;
    box-shadow: 0 12px 28px rgba(10,58,130,.22);
}

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

.message {
    margin-bottom: 18px;
    padding: 12px 14px;
    border-radius: 9px;
    color: #851d1d;
    background: #fff0f0;
    border: 1px solid #ffd2d2;
    font-size: 14px;
}

.support {
    margin: 25px 0 0;
    text-align: center;
    color: var(--muted);
    font-size: 13px;
}

.dashboard {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 255px 1fr;
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 255px;
    padding: 22px 15px;
    display: flex;
    flex-direction: column;
    color: white;
    background: var(--blue-950);
    z-index: 20;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 8px 25px;
    border-bottom: 1px solid rgba(255,255,255,.1);
}

.sidebar-brand strong,
.sidebar-brand small {
    display: block;
}

.sidebar-brand small {
    margin-top: 3px;
    color: #95acd1;
}

.sidebar nav {
    margin-top: 22px;
    display: grid;
    gap: 5px;
}

.nav-item {
    padding: 13px 15px;
    border: 0;
    border-radius: 9px;
    color: #bdcce5;
    background: transparent;
    text-align: left;
}

.nav-item:hover,
.nav-item.active {
    color: white;
    background: rgba(255,255,255,.1);
}

.nav-item.active {
    border-left: 3px solid var(--green);
}

.sidebar-footer {
    margin-top: auto;
    padding: 15px 8px 0;
    color: #aebfda;
}

.sidebar-footer span,
.sidebar-footer small {
    display: block;
}

.dashboard-content {
    grid-column: 2;
    min-width: 0;
}

.topbar {
    min-height: 78px;
    padding: 14px 28px;
    display: flex;
    align-items: center;
    gap: 18px;
    background: white;
    border-bottom: 1px solid var(--border);
}

.topbar h2,
.topbar p {
    margin: 0;
}

.topbar h2 {
    font-size: 18px;
}

.topbar p {
    margin-top: 3px;
    color: var(--muted);
    font-size: 13px;
}

.menu-button {
    display: none;
    border: 0;
    background: transparent;
    font-size: 25px;
}

.user-menu {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    color: white;
    background: var(--blue-800);
    font-weight: 800;
}

.user-data strong,
.user-data small {
    display: block;
}

.user-data small {
    margin-top: 2px;
    color: var(--muted);
}

.logout-button {
    margin-left: 10px;
    padding: 9px 13px;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--danger);
    background: white;
}

.page-content {
    padding: 28px;
}

.welcome {
    padding: 25px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    border-radius: var(--radius);
    color: white;
    background: linear-gradient(135deg, var(--blue-950), var(--blue-800));
    box-shadow: var(--shadow);
}

.welcome h1 {
    margin: 12px 0 6px;
    font-size: 29px;
}

.welcome p {
    margin: 0;
    color: #c9dcff;
}

.status-badge {
    padding: 11px 14px;
    border-radius: 999px;
    color: #d9ffca;
    background: rgba(67,214,0,.16);
    white-space: nowrap;
    font-size: 13px;
    font-weight: 700;
}

.stats-grid {
    margin-top: 22px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.stat-card,
.panel {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 8px 30px rgba(9,38,83,.05);
}

.stat-card {
    padding: 20px;
}

.stat-card span,
.stat-card strong,
.stat-card small {
    display: block;
}

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

.stat-card strong {
    margin: 11px 0;
    color: var(--blue-900);
    font-size: 31px;
}

.stat-card small {
    color: #8791a1;
}

.stat-card.green {
    border-top: 3px solid var(--green);
}

.content-grid {
    margin-top: 20px;
    display: grid;
    grid-template-columns: 1.2fr .8fr;
    gap: 18px;
}

.panel {
    padding: 22px;
}

.panel-header {
    padding-bottom: 17px;
    border-bottom: 1px solid var(--border);
}

.panel-header h3,
.panel-header p {
    margin: 0;
}

.panel-header p {
    margin-top: 5px;
    color: var(--muted);
    font-size: 13px;
}

.service-list {
    display: grid;
}

.service-item {
    padding: 16px 0;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border);
}

.service-item:last-child {
    border-bottom: 0;
}

.service-item strong,
.service-item small {
    display: block;
}

.service-item small {
    margin-top: 3px;
    color: var(--muted);
}

.service-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #b7bfca;
    box-shadow: 0 0 0 5px rgba(183,191,202,.15);
}

.service-dot.online {
    background: var(--green);
    box-shadow: 0 0 0 5px rgba(67,214,0,.13);
}

.service-dot.offline {
    background: #e53935;
    box-shadow: 0 0 0 5px rgba(229,57,53,.13);
}

.profile-list {
    margin: 0;
}

.profile-list div {
    padding: 14px 0;
    display: grid;
    grid-template-columns: 100px 1fr;
    gap: 15px;
    border-bottom: 1px solid var(--border);
}

.profile-list div:last-child {
    border-bottom: 0;
}

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

.profile-list dd {
    margin: 0;
    overflow-wrap: anywhere;
    font-weight: 700;
}

@media (max-width: 1050px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 820px) {
    .login-page {
        grid-template-columns: 1fr;
    }

    .login-brand {
        display: none;
    }

    .mobile-brand {
        display: flex;
    }

    .dashboard {
        display: block;
    }

    .sidebar {
        transform: translateX(-100%);
        transition: transform .25s ease;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .dashboard-content {
        min-height: 100vh;
    }

    .menu-button {
        display: block;
    }

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

@media (max-width: 600px) {
    .login-area {
        align-items: start;
        padding-top: 30px;
    }

    .topbar {
        padding: 12px 15px;
    }

    .topbar > div:nth-child(2) {
        display: none;
    }

    .user-data {
        display: none;
    }

    .logout-button {
        margin-left: 0;
    }

    .page-content {
        padding: 16px;
    }

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

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