/* CORREÇÃO DO LAYOUT PRINCIPAL */
html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    max-width: 100%;
}

body {
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
}

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    height: 100vh;
    box-sizing: border-box;
}

.main {
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    min-height: 100vh;
    box-sizing: border-box;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --sidebar-width: 250px;
    --bg: #0b1010;
    --card: #141b1c;
    --text: #eef2ee;
    --muted: #a4b2b0;
    --border: #2b3838;
    --primary: #37cfb0;
    --primary-dark: #7be6ce;
    --green: #51d9a3;
    --yellow: #e7bc64;
    --red: #ff9292;
    --sidebar: #0c1213;
    --gold: #e7bc64;
    color-scheme: dark;
}

.mobile-menu-toggle {
    display: none;
}

body {
    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
    background: var(--bg);
    color: var(--text);
}

body.unauthenticated {
    display: block;
}

body.unauthenticated > .sidebar,
body.unauthenticated > .main,
body.unauthenticated > .modal,
body.unauthenticated > #toast {
    display: none;
}

.login-screen {
    display: none;
    min-height: 100vh;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: linear-gradient(135deg, #0b1514, #151710);
}

body.unauthenticated .login-screen {
    display: flex;
}

.login-card {
    width: min(100%, 420px);
    padding: 32px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--card);
    box-shadow: 0 18px 48px #eef2ee1a;
}

.login-brand {
    padding: 0 0 26px;
}

.login-card h1 {
    font-size: 22px;
}

.login-card > p {
    margin: 7px 0 24px;
    color: var(--muted);
}

.login-card form {
    display: grid;
    gap: 16px;
}

.login-submit,
.logout-btn,
.secondary-btn {
    border: 0;
    border-radius: 8px;
    background: var(--primary);
    color: #fff;
    font-weight: 700;
}

.login-submit {
    padding: 11px 14px;
}

.admin-identity {
    display: grid;
    gap: 3px;
    margin-bottom: 10px;
    color: #fff;
    font-size: 12px;
}

.admin-identity span {
    color: #a4b2b0;
    overflow-wrap: anywhere;
}

.logout-btn {
    width: 100%;
    margin-bottom: 14px;
    padding: 8px;
    background: #344544;
}

.secondary-btn {
    padding: 10px 14px;
    background: #20302f;
    color: var(--text);
}

.secondary-btn:hover:not(:disabled) {
    background: #2c4140;
}

button,
input,
textarea,
select {
    font: inherit;
}

button {
    cursor: pointer;
}

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

.sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    background: var(--sidebar);
    color: white;
    padding: 22px 15px;
    display: flex;
    flex-direction: column;
}

.brand {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 5px 10px 28px;
}

.brand-logo {
    display: block;
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    object-fit: contain;
    border-radius: 10px;
}

.brand strong {
    display: block;
    font-size: 15px;
}

.brand span {
    display: block;
    font-size: 11px;
    color: #a4b2b0;
    margin-top: 3px;
}

nav {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.nav-item {
    width: 100%;
    border: 0;
    background: transparent;
    color: #a4b2b0;
    text-align: left;
    padding: 12px 13px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: .2s;
}

.nav-item:hover {
    background: #1b2928;
    color: white;
}

.nav-item.active {
    background: #37cfb0;
    color: white;
}

.nav-item span {
    width: 20px;
    text-align: center;
}

.sidebar-bottom {
    margin-top: auto;
    padding: 15px 10px 5px;
}

.connection {
    font-size: 12px;
    color: #a4b2b0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.connection-dot {
    width: 8px;
    height: 8px;
    background: #37cfb0;
    border-radius: 50%;
}

.main {
    flex: 1;
    min-width: 0;
}

.topbar {
    height: 86px;
    background: var(--card);
    border-bottom: 1px solid var(--border);
    padding: 0 34px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.topbar h1 {
    font-size: 23px;
}

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

.refresh-btn {
    border: 1px solid var(--border);
    background: var(--card);
    padding: 9px 15px;
    border-radius: 8px;
    color: #344544;
}

.refresh-btn:hover {
    background: #192322;
}

.section {
    display: none;
    padding: 30px 34px;
}

.section.active {
    display: block;
}

.stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    margin-bottom: 22px;
}

.stat-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 13px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
}

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

.stat-card strong {
    display: block;
    font-size: 26px;
    margin-top: 5px;
}

.stat-icon {
    width: 43px;
    height: 43px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.stat-icon.blue {
    background: #142d2a;
    color: #37cfb0;
}

.stat-icon.yellow {
    background: #332b1a;
    color: #e7bc64;
}

.stat-icon.green {
    background: #142e24;
    color: #51d9a3;
}

.stat-icon.red {
    background: #352124;
    color: #ff9292;
}

.panel.system-status-panel {
    padding: 0;
    overflow: hidden;
}

.system-status-header {
    padding: 20px 22px 0;
}

.sao-paulo-clock {
    min-width: 178px;
    text-align: right;
}

.sao-paulo-clock span,
.sao-paulo-clock small {
    display: block;
    color: var(--muted);
    font-size: 11px;
}

.sao-paulo-clock strong {
    display: block;
    margin: 4px 0;
    font-size: 14px;
}

.system-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.system-metric {
    min-width: 0;
    padding: 20px 22px;
    border-right: 1px solid var(--border);
}

.system-metric:last-child {
    border-right: 0;
}

.system-metric-label,
.system-metric-detail {
    display: block;
    color: var(--muted);
    font-size: 11px;
}

.system-metric strong {
    display: block;
    margin: 7px 0 6px;
    font-size: 22px;
}

.system-metric-detail {
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.system-services {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
    padding: 16px 22px;
}

.system-service {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.system-service > span {
    color: var(--muted);
    font-size: 11px;
}

.system-service > strong:not(.health-badge) {
    font-size: 15px;
}

.health-badge {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 10px;
    white-space: nowrap;
}

.health-badge.healthy {
    color: #75dfb2;
    background: #183529;
}

.health-badge.unhealthy {
    color: #ffa3a3;
    background: #3b2225;
}

.health-badge.unavailable {
    color: #b1bcbc;
    background: #263130;
}

.system-alerts {
    min-height: 42px;
    padding: 0 22px 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.system-alert,
.system-ok,
.system-unavailable {
    display: inline-flex;
    align-items: center;
    padding: 6px 9px;
    border-radius: 6px;
    font-size: 11px;
}

.system-ok {
    color: #75dfb2;
    background: #142e24;
}

.system-unavailable {
    color: #b1bcbc;
    background: #263130;
}

.system-alert.warning {
    color: #e7bc64;
    background: #332b1a;
}

.system-alert.critical {
    color: #ffa3a3;
    background: #352124;
}

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

.panel,
.form-panel {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 13px;
    padding: 23px;
    margin-bottom: 20px;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.panel-header h2 {
    font-size: 16px;
}

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

.account-search {
    margin-bottom: 16px;
}

.small-btn {
    border: 1px solid var(--border);
    background: var(--card);
    border-radius: 7px;
    padding: 8px 12px;
    font-size: 12px;
}

.small-btn:hover {
    background: #192322;
}

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

.account-summary {
    min-height: 80px;
}

.account-card {
    display: flex;
    align-items: center;
    gap: 13px;
}

.account-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: #142d2a;
    color: #37cfb0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.account-info strong {
    display: block;
    font-size: 14px;
}

.account-info {
    min-width: 0;
}

.account-info span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    margin-top: 4px;
    overflow-wrap: anywhere;
}

.status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 20px;
    padding: 5px 9px;
    font-size: 11px;
    font-weight: 600;
}

.status.success {
    color: #75dfb2;
    background: #142e24;
}

.status.queued {
    color: #7be6ce;
    background: #142d2a;
}

.status.running {
    color: #e7bc64;
    background: #332b1a;
}

.status.failed {
    color: #ffa3a3;
    background: #352124;
}

.status.cancelled {
    color: #b1bcbc;
    background: #263130;
}

.job-row {
    border: 1px solid var(--border);
    border-radius: 9px;
    padding: 14px;
    margin-bottom: 9px;
    display: flex;
    justify-content: space-between;
    gap: 15px;
}

.job-main {
    min-width: 0;
}

.job-message {
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 500px;
}

.job-meta {
    color: var(--muted);
    font-size: 11px;
    margin-top: 5px;
    overflow-wrap: anywhere;
}

.job-context {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 12px;
}

.job-context span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.job-position {
    color: var(--text);
    font-weight: 600;
}

.performance-job {
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 10px;
    overflow: hidden;
}

.performance-job summary {
    min-height: 64px;
    padding: 13px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    cursor: pointer;
}

.performance-job-title {
    min-width: 0;
}

.performance-job-title strong,
.performance-job-title small {
    display: block;
    overflow-wrap: anywhere;
}

.performance-job-title small {
    margin-top: 5px;
    color: var(--muted);
}

.performance-summary-value {
    flex: 0 0 auto;
    color: var(--muted);
    font-size: 12px;
}

.performance-sections {
    padding: 0 16px 16px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.performance-group {
    min-width: 0;
    border-top: 1px solid var(--border);
    padding-top: 12px;
}

.performance-group h3 {
    margin-bottom: 8px;
    font-size: 12px;
}

.performance-group dl > div {
    min-width: 0;
    padding: 5px 0;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 11px;
}

.performance-group dt {
    color: var(--muted);
}

.performance-group dd {
    min-width: 0;
    text-align: right;
    overflow-wrap: anywhere;
}

.performance-analysis,
.performance-empty {
    margin: 0 16px 16px;
    padding: 12px;
    border-radius: 6px;
    background: #192322;
    font-size: 12px;
}

.performance-analysis strong,
.performance-analysis span {
    display: block;
}

.performance-analysis span {
    margin-top: 5px;
    color: var(--muted);
}

.job-status {
    flex-shrink: 0;
    display: flex;
    align-items: flex-end;
    flex-direction: column;
    gap: 7px;
}

.danger-btn {
    color: #ffa3a3;
    border-color: #79444a;
}

.danger-btn:hover {
    background: #352124;
}

.empty,
.loading {
    color: var(--muted);
    font-size: 13px;
    padding: 20px 0;
}

.weekday-filters {
    display: flex;
    gap: 8px;
    margin-bottom: 18px;
    padding-bottom: 4px;
    overflow-x: auto;
}

.weekday-filter {
    min-height: 38px;
    flex: 0 0 auto;
    border: 1px solid var(--border);
    border-radius: 7px;
    padding: 8px 12px;
    background: var(--card);
    color: var(--muted);
}

.weekday-filter.active {
    border-color: var(--primary);
    background: #142d2a;
    color: var(--primary-dark);
    font-weight: 700;
}

.schedule-card {
    display: grid;
    grid-template-columns: 70px minmax(0, 1fr) auto;
    gap: 16px;
    align-items: start;
    margin-bottom: 12px;
    padding: 16px;
    border: 2px solid;
    border-radius: 8px;
    transition: border-color .2s, background-color .2s, box-shadow .2s;
}

.schedule-card.robot-disabled {
    border-color: #37cfb0;
    background: #142d2a;
    box-shadow: 0 3px 12px #37cfb01f;
}

.schedule-card.robot-enabled {
    border-color: #37cfb0;
    background: #132d25;
    box-shadow: 0 0 0 2px #37cfb040, 0 5px 18px #37cfb038;
}

.schedule-card.robot-disabled .schedule-heading > strong,
.schedule-card.robot-enabled .schedule-heading > strong {
    border-radius: 5px;
    padding: 3px 7px;
}

.schedule-card.robot-disabled .schedule-heading > strong {
    background: #1c3934;
    color: #7be6ce;
}

.schedule-card.robot-enabled .schedule-heading > strong {
    background: #1e4838;
    color: #8ae8bb;
}

.robot-status-badge {
    border-radius: 5px;
    padding: 5px 8px;
    font-size: 10px;
    font-weight: 800;
}

.robot-disabled .robot-status-badge {
    background: #37cfb0;
    color: #fff;
}

.robot-enabled .robot-status-badge {
    background: #37cfb0;
    color: #09271f;
    box-shadow: 0 0 10px #37cfb070;
}

.robot-disabled .toggle-robot-status-btn {
    border-color: #37cfb0;
    color: #7be6ce;
    background: var(--card);
}

.robot-enabled .toggle-robot-status-btn {
    border-color: #37cfb0;
    color: #8ae8bb;
    background: #1c3e32;
}

.schedule-time {
    color: var(--primary-dark);
    font-size: 20px;
    font-weight: 700;
}

.schedule-content {
    min-width: 0;
}

.schedule-heading,
.schedule-meta,
.schedule-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.schedule-heading {
    align-items: center;
}

.schedule-heading strong,
.schedule-message,
.schedule-notes {
    overflow-wrap: anywhere;
}

.schedule-type {
    border-radius: 12px;
    padding: 4px 8px;
    font-size: 10px;
    font-weight: 700;
}

.schedule-type.grupo_aberto {
    background: #142d2a;
    color: #7be6ce;
}

.schedule-type.grupo_fechado {
    background: #142e24;
    color: #75dfb2;
}

.schedule-type.com_ok {
    background: #332b1a;
    color: #e7bc64;
}

.schedule-meta {
    margin-top: 7px;
    color: var(--muted);
    font-size: 11px;
}

.schedule-message {
    max-width: 720px;
    margin-top: 10px;
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    font-size: 13px;
    line-height: 1.5;
}

.schedule-notes {
    display: block;
    margin-top: 7px;
    color: var(--muted);
}

.schedule-actions {
    justify-content: flex-end;
}

.schedule-telegram-slot {
    flex: 0 0 auto;
}

.telegram-slot-select {
    width: auto;
    max-width: 160px;
    min-height: 34px;
    border: 1px solid #344544;
    border-radius: 7px;
    padding: 7px 30px 7px 10px;
    background: var(--card);
    color: var(--text);
    font-size: 12px;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.schedule-modal-card {
    width: min(100%, 680px);
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

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

.form-group label {
    font-size: 13px;
    font-weight: 600;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    border: 1px solid #344544;
    border-radius: 8px;
    padding: 11px 12px;
    background: var(--card);
    color: var(--text);
    outline: none;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px #37cfb014;
}

.form-group textarea {
    resize: vertical;
    min-height: 150px;
}

.form-group small {
    color: var(--muted);
    font-size: 11px;
}

.char-count {
    text-align: right;
    color: var(--muted);
    font-size: 11px;
}

.timezone-info {
    margin-top: 20px;
    padding: 12px 14px;
    background: #192322;
    border-radius: 8px;
    color: #a4b2b0;
    font-size: 12px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 20px;
}

.primary-btn {
    border: 0;
    background: var(--primary);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 600;
}

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

.primary-btn:disabled {
    opacity: .6;
    cursor: wait;
}

.result {
    margin-top: 20px;
    padding: 15px;
    border-radius: 9px;
    font-size: 13px;
}

.result.success {
    background: #142e24;
    color: #75dfb2;
}

.result.error {
    background: #352124;
    color: #ffa3a3;
}

.hidden {
    display: none;
}

.form-hint {
    color: var(--muted);
    font-size: 12px;
    margin-top: 16px;
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: #0c121380;
}

.modal.hidden {
    display: none;
}

.modal-card {
    width: min(100%, 520px);
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    background: var(--card);
    border-radius: 13px;
    padding: 24px;
    box-shadow: 0 20px 55px #0c121340;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

.modal-header h2 {
    font-size: 18px;
}

.modal-header p {
    color: var(--muted);
    font-size: 12px;
    margin-top: 4px;
}

.modal-close {
    border: 0;
    background: transparent;
    color: var(--muted);
    font-size: 28px;
    line-height: 1;
}

.toast {
    position: fixed;
    right: 25px;
    bottom: 25px;
    background: #0c1213;
    color: white;
    padding: 12px 17px;
    border-radius: 8px;
    font-size: 13px;
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
    transition: .25s;
    z-index: 1000;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 900px) {
    :root {
        --sidebar-width: 205px;
    }

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

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

    .system-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .system-metric:nth-child(2) {
        border-right: 0;
    }

    .system-metric:nth-child(-n + 2) {
        border-bottom: 1px solid var(--border);
    }

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

@media (max-width: 650px) {
    :root {
        --sidebar-width: 0px;
    }

    body {
        display: block;
        min-width: 0;
    }

    .sidebar {
        position: sticky;
        top: 0;
        right: auto;
        bottom: auto;
        z-index: 1000;
        width: 100%;
        height: auto;
        min-height: auto;
        padding: 10px 14px;
        display: block;
        border-bottom: 1px solid #2b3838;
    }

    .brand {
        min-height: 48px;
        padding: 0 54px 0 0;
    }

    .brand-logo {
        width: 42px;
        height: 42px;
        flex-basis: 42px;
        border-radius: 8px;
    }

    .mobile-menu-toggle {
        position: absolute;
        top: 12px;
        right: 14px;
        display: inline-flex;
        width: 44px;
        height: 44px;
        align-items: center;
        justify-content: center;
        border: 1px solid #344544;
        border-radius: 8px;
        background: #1b2928;
        color: white;
        font-size: 24px;
        line-height: 1;
    }

    nav {
        display: none;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        padding-top: 10px;
    }

    .nav-item {
        min-height: 48px;
        padding: 10px;
        white-space: normal;
    }

    .sidebar-bottom {
        display: none;
    }

    .sidebar.mobile-menu-open nav {
        display: grid;
    }

    .sidebar.mobile-menu-open .sidebar-bottom {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        gap: 10px;
        margin-top: 10px;
        padding: 10px 0 0;
        border-top: 1px solid #344544;
    }

    .sidebar-bottom .admin-identity {
        min-width: 0;
        margin: 0;
    }

    .sidebar-bottom .logout-btn {
        width: auto;
        min-width: 72px;
        min-height: 44px;
        margin: 0;
        padding: 10px 14px;
    }

    .sidebar-bottom .connection {
        display: none;
    }

    .main {
        width: 100%;
        min-width: 0;
        margin-left: 0;
    }

    .topbar {
        gap: 12px;
        padding: 16px;
        height: auto;
    }

    .topbar > div {
        min-width: 0;
    }

    .topbar h1 {
        font-size: 20px;
    }

    .topbar p {
        overflow-wrap: anywhere;
    }

    .refresh-btn {
        min-height: 44px;
        padding: 9px 12px;
        flex: 0 0 auto;
    }

    .section {
        min-width: 0;
        padding: 16px;
    }

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

    .system-status-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .sao-paulo-clock {
        min-width: 0;
        text-align: left;
    }

    .system-metrics,
    .system-services {
        grid-template-columns: 1fr;
    }

    .system-status-header,
    .system-metric,
    .system-services {
        padding-left: 16px;
        padding-right: 16px;
    }

    .system-service {
        min-height: 36px;
    }

    .system-alerts {
        padding-right: 16px;
        padding-left: 16px;
    }

    .system-metric,
    .system-metric:nth-child(2) {
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }

    .system-metric:last-child {
        border-bottom: 0;
    }

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

    .form-group.full {
        grid-column: auto;
    }

    .panel,
    .form-panel {
        min-width: 0;
        padding: 16px;
    }

    .panel-header {
        align-items: flex-start;
        gap: 12px;
    }

    .panel-actions {
        flex-wrap: wrap;
        justify-content: flex-end;
    }

    .small-btn,
    .primary-btn,
    .secondary-btn,
    .login-submit {
        min-height: 44px;
    }

    .form-group input,
    .form-group textarea,
    .form-group select {
        min-height: 46px;
        font-size: 16px;
    }

    .form-actions {
        flex-wrap: wrap;
        gap: 10px;
    }

    .form-actions > button {
        flex: 1 1 180px;
    }

    .job-row {
        min-width: 0;
        flex-direction: column;
        gap: 12px;
    }

    .job-message {
        max-width: 100%;
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .job-context {
        display: grid;
        grid-template-columns: 1fr;
    }

    .job-status {
        width: 100%;
        align-items: stretch;
        flex-direction: row;
        flex-wrap: wrap;
    }

    .job-status .status {
        min-height: 32px;
        margin-right: auto;
    }

    .job-status button {
        min-height: 44px;
    }

    .account-card {
        align-items: flex-start;
    }

    .schedule-card {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .schedule-actions {
        justify-content: stretch;
    }

    .schedule-actions button {
        min-height: 44px;
        flex: 1 1 130px;
    }

    .schedule-telegram-slot,
    .telegram-slot-select {
        width: 100%;
        max-width: none;
    }

    .telegram-slot-select {
        min-height: 44px;
        font-size: 16px;
    }

    .performance-job summary {
        align-items: flex-start;
        flex-direction: column;
    }

    .performance-sections {
        grid-template-columns: 1fr;
        padding-right: 12px;
        padding-left: 12px;
    }

    .performance-summary-value {
        flex: auto;
    }

    .performance-group dl > div {
        align-items: flex-start;
    }

    .performance-analysis,
    .performance-empty {
        margin-right: 12px;
        margin-left: 12px;
    }

    .modal {
        align-items: flex-end;
        padding: 8px;
    }

    .modal-card {
        max-height: calc(100vh - 16px);
        max-height: calc(100dvh - 16px);
        padding: 18px 16px;
        border-radius: 8px;
    }

    .modal-close {
        width: 44px;
        height: 44px;
        flex: 0 0 auto;
    }

    .toast {
        right: 12px;
        bottom: 12px;
        left: 12px;
        max-width: none;
        text-align: center;
    }

    .login-screen {
        min-height: 100vh;
        min-height: 100dvh;
        padding: 16px;
    }

    .login-card {
        padding: 22px 18px;
        border-radius: 8px;
    }
}

@media (max-width: 360px) {
    .topbar {
        align-items: flex-start;
    }

    .refresh-btn {
        width: 44px;
        padding: 0;
        font-size: 0;
    }

    .refresh-btn::before {
        content: "↻";
        color: #344544;
        font-size: 20px;
    }

    .section {
        padding: 12px;
    }

    .panel-header:not(.system-status-header) {
        flex-direction: column;
    }

    .panel-actions,
    .panel-header > .small-btn {
        width: 100%;
    }

    .panel-actions .small-btn,
    .panel-header > .small-btn {
        flex: 1 1 auto;
        min-height: 44px;
    }
}

/* LMSoluções Senha Baixa — visual identity; existing interaction selectors retained. */
body { line-height: 1.5; }
.main { background: radial-gradient(ellipse at top right, #12332b45, transparent 55%), var(--bg); }
.sidebar { border-right: 1px solid var(--border); overflow-y: auto; }
.brand { gap: 10px; }
.brand > div { min-width: 0; }
.brand strong { color: var(--gold); font-size: 14px; line-height: 1.4; }
.brand-logo { object-fit: cover; object-position: 19% 20%; border: 1px solid #e7bc6440; }
.brand span { color: var(--muted); }
.nav-item { min-height: 46px; border: 1px solid transparent; }
.nav-item.active { color: var(--gold); background: linear-gradient(100deg, #e7bc641c, #37cfb00a); border-color: #e7bc643d; box-shadow: inset 3px 0 var(--gold); }
.nav-item span { color: var(--primary); }
.topbar { height: auto; min-height: 108px; gap: 20px; padding-top: 18px; padding-bottom: 18px; background: #101818; }
.header-brand { display: block; color: var(--gold); font-size: 11px; letter-spacing: .09em; margin-bottom: 4px; }
.topbar h1 { font-weight: 650; letter-spacing: -.035em; }
.panel, .form-panel, .stat-card { box-shadow: 0 8px 28px #00000018; }
.stat-card { background: linear-gradient(135deg, #1b2423, var(--card)); border-top-color: #e7bc6440; }
.stat-card strong { font-size: 30px; font-weight: 650; }
.stat-icon { flex-shrink: 0; }
.panel-header h2 { font-weight: 600; }
.small-btn, .refresh-btn, .secondary-btn, .logout-btn { color: var(--text); border: 1px solid var(--border); }
button { transition: background-color .2s, border-color .2s, box-shadow .2s; }
button:hover:not(:disabled) { border-color: #71998e; }
.login-submit, .primary-btn { background: linear-gradient(115deg, #42d6b7, #24bda1); color: #06261f; border: 1px solid #63dfc3; box-shadow: 0 5px 18px #00b79518; }
.login-submit:hover:not(:disabled), .primary-btn:hover:not(:disabled) { background: #73e5cd; }
button:disabled { opacity: .6; cursor: not-allowed; }
button:focus-visible, summary:focus-visible, a:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }
.form-group input, .form-group textarea, .form-group select { background: #0f1717; }
input::placeholder, textarea::placeholder { color: #8d9e9b; opacity: 1; }
.form-group input:focus, .form-group textarea:focus, .form-group select:focus { box-shadow: 0 0 0 3px #37cfb020; }
.weekday-filter.active { color: var(--gold); border-color: #e7bc6480; background: #e7bc6412; }
.schedule-card.robot-enabled { box-shadow: 0 0 0 1px #37cfb030; }
.robot-disabled .robot-status-badge { color: #09271f; }
.modal { background: #020707ba; backdrop-filter: blur(6px); }
.modal-card { border: 1px solid #3b514c; }
.toast { border: 1px solid #37cfb060; }
.app-footer { margin: 0 34px; padding: 22px 0; border-top: 1px solid var(--border); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 11px; color: var(--muted); }
.app-footer strong { color: var(--gold); font-weight: 500; }
.login-screen { min-height: 100dvh; padding: 40px; background: radial-gradient(ellipse at 10% 25%, #a8781928, transparent 50%), radial-gradient(ellipse at 90% 80%, #008a7320, transparent 50%), #080e0e; }
.login-layout { width: min(100%, 1320px); display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: center; gap: clamp(24px, 5vw, 80px); }
.login-art { overflow: hidden; border-radius: 24px; aspect-ratio: .99; }
.login-art img { display: block; width: 180%; height: auto; max-width: none; }
.login-card { width: 100%; max-width: 490px; justify-self: center; padding: clamp(24px, 3vw, 46px); background: linear-gradient(155deg, #1a2323, #0e1515); border: 1px solid #37cfb045; box-shadow: 0 24px 80px #00000050, inset 0 1px #e7bc6430; border-radius: 22px; }
.login-card .login-brand { padding: 0 0 36px; }
.login-card .brand-logo { display: none; }
.login-card .brand strong { font-size: clamp(20px, 2vw, 26px); font-family: Georgia, serif; font-weight: 500; }
.login-card .brand span { color: var(--primary); letter-spacing: .08em; margin-top: 8px; }
.login-eyebrow { color: var(--gold); font-size: 10px; letter-spacing: .18em; margin-bottom: 8px; }
.login-card h1 { font-size: 32px; font-weight: 600; letter-spacing: -.035em; }
.login-card > p { font-size: 14px; margin-bottom: 28px; }
.login-card form { gap: 20px; }
.login-card input { min-height: 50px; }
.login-submit { min-height: 50px; font-size: 16px; margin-top: 4px; }
.login-footer { margin-top: 32px; padding-top: 22px; border-top: 1px solid var(--border); color: var(--muted); text-align: center; font-size: 11px; }
.login-footer span { display: block; margin-top: 5px; font-size: 10px; letter-spacing: .04em; }
@media (min-width: 651px) and (max-width: 1100px) {
    .system-services { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .schedule-card { grid-template-columns: 1fr; }
    .schedule-actions { justify-content: flex-start; }
    .panel-header { flex-wrap: wrap; gap: 12px; }
    .job-row { flex-wrap: wrap; }
}
@media (max-width: 900px) {
    .login-screen { padding: 24px; }
    .login-layout { gap: 24px; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .login-card { padding: 26px; }
}
@media (max-width: 650px) {
    .sidebar { width: 100%; max-height: 100dvh; }
    .sidebar .brand strong { font-size: 13px; }
    .topbar { min-height: 104px; }
    .header-brand { font-size: 10px; letter-spacing: .025em; }
    .app-footer { margin: 0 16px; flex-direction: column; gap: 4px; }
    .login-screen { padding: 24px 16px; align-items: flex-start; }
    .login-layout { grid-template-columns: minmax(0, 1fr); gap: 20px; max-width: 460px; }
    .login-art { width: min(100%, 330px); justify-self: center; aspect-ratio: 1.6; border-radius: 16px; }
    .login-art img { margin-top: -8%; }
    .login-card { padding: 26px 22px; border-radius: 18px; }
    .login-card .login-brand { padding-bottom: 24px; min-height: auto; }
    .login-card h1 { font-size: 28px; }
    .refresh-btn::before { color: var(--gold); }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}

/* Preserve a clear visual distinction between operational states. */
.schedule-card.robot-disabled { border-color: #8a7445; background: #25241b; box-shadow: none; }
.schedule-card.robot-disabled .schedule-heading > strong { background: #3b321f; color: var(--gold); }
.robot-disabled .robot-status-badge { background: #3b321f; color: var(--gold); }
.robot-disabled .toggle-robot-status-btn { border-color: #8a7445; color: var(--gold); }
.small-btn.danger-btn { color: #ffa3a3; border-color: #79444a; }
