/* Reset e estilos globais */
body {
    margin: 0;
    background: #f5f5f5;
    font-family: Arial, sans-serif;
}
body.login-bg {
    background: #F5F5F5 !important; /* fundo cinza só para o login */
}

/* Sidebar */
.sidebar {
    width: 220px;
    background: #222;
    color: #fff;
    min-height: 100vh;
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    display: flex;
    flex-direction: column;
    padding-top: 30px;
}
.sidebar h2 {
    text-align: center;
    margin-bottom: 40px;
    font-size: 1.4rem;
    letter-spacing: 1px;
}
.sidebar a {
    color: #fff;
    text-decoration: none;
    padding: 15px 30px;
    display: block;
    transition: background 0.2s;
    font-size: 1.1rem;
}
.sidebar a:hover, .sidebar a.active {
    background: #3A5A75;
}
.logout-link {
    margin-top: auto;
    margin-bottom: 20px;
}
.logout-link a {
    background: #3A5A75;
    color: #fff;
    border-radius: 0;
    font-weight: bold;
    text-align: center;
    display: block;
    padding: 15px 30px;
}
.logout-link a:hover {
    background: #76BADA;
}

/* Main Content (a partir da sidebar) */
.main-content {
    margin-left: 220px;
    padding: 40px 30px;
    /* Remova display: flex, flex-direction, align-items, background */
}

/* Logo */
.logo-container {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
}
.logo-img {
    max-width: 180px;
    max-height: 120px;
    display: block;
}

/* Botões Diversos */
.btn-add,
.btn-save,
.btn-delete {
    background: #2d3e50;
    color: #fff;
    border: none;
    padding: 8px 18px;
    border-radius: 4px;
    margin-top: 10px;
    cursor: pointer;
    font-size: 15px;
    transition: background 0.2s;
}
.btn-add {
    display: inline-block;
    margin-bottom: 20px;
    background: #3A5A75;
    color: #fff;
    padding: 10px 22px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: bold;
    transition: background 0.2s;
}
.btn-add:hover {
    background: #76BADA;
    color: #222;
}
.btn-add:hover,
.btn-save:hover {
    background: #1abc9c;
}
.btn-save {
    background: #3A5A75;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 10px 18px;
    font-size: 1em;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-save:hover {
    background: #27415a;
}
.btn-delete {
    background: #e74c3c;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 6px 16px;
    font-size: 0.97em;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.18s;
    margin-left: 10px;
    min-width: unset;    /* Remove largura mínima */
    min-height: 0;
    box-shadow: none;
    line-height: 1.2;
    display: inline-block;
}

/* Tabelas (usadas em campanhas ou listagens) */
table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    overflow: hidden;
}
th, td {
    padding: 14px 18px;
    text-align: left;
}
th {
    background: #3A5A75;
    color: #fff;
    font-weight: bold;
}
tr:nth-child(even) {
    background: #f2f6fa;
}
tr:hover {
    background: #eaf2fb;
}
td a {
    color: #3A5A75;
    font-weight: bold;
    text-decoration: none;
    margin-right: 8px;
}
td a:hover {
    text-decoration: underline;
    color: #76BADA;
}

/* Login */
.login-container {
    width: 350px;
    margin: 48px auto;              /* Espaçamento reduzido */
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 18px 30px 16px 30px;    /* Padding reduzido */
    position: relative;
}
.login-container h2 {
    text-align: center;
    margin-bottom: 25px;
}
.login-container input[type="text"],
.login-container input[type="password"] {
    width: 100%;
    padding: 10px;
    margin-bottom: 18px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
    box-sizing: border-box;
}
.login-container button,
.login-container .btn-registre {
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    font-family: inherit;
    font-weight: 400;
    margin-bottom: 16px;
    box-sizing: border-box;
    text-align: center;
    display: block;
    transition: background 0.2s;
}
.login-container button {
    background: #222;
    color: #fff;
}
.login-container .btn-registre {
    background: #007bff;
    color: #fff;
    text-decoration: none;
}
.login-container .btn-registre:hover {
    background: #0056b3;
}
.login-container .btn-registre svg,
.login-container button svg {
    margin-right: 6px;
    vertical-align: middle;
}
.login-container .erro {
    color: #c00;
    text-align: center;
    margin-bottom: 10px;
}
.login-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 1.25rem;
    font-weight: bold;
    margin-bottom: 18px;
    margin-top: 0;
}

/* Popup de Cadastro */
.popup-cadastro-bg {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(0,0,0,0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}
.popup-cadastro-bg.show {
    display: flex;
}
.popup-cadastro-box {
    background: #fff;
    padding: 24px 28px 18px 28px;
    border-radius: 8px;
    width: 100%;
    max-width: 400px;
    box-sizing: border-box;
    position: relative;
    min-width: 340px;
}
.popup-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
}
.form-group {
    margin-bottom: 15px;
}
.form-group label {
    display: block;
    margin-bottom: 5px;
}
.form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
}
.form-group span {
    color: #c00;
    font-size: 13px;
}
#cad-msg {
    margin-top: 10px;
    text-align: center;
}

/* Dashboard - Logo grande */
.logo-top-dashboard {
    text-align: center;
    margin-top: 40px;
    margin-bottom: 30px;
}
.logo-top-dashboard img,
.logo-top-img {
    max-width: 340px;
    width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

/* Cards para Campanhas / Horários */
.campanha-cards-container {
    display: flex;
    flex-direction: column;
    gap: 28px;
    margin-bottom: 32px;
    align-items: flex-start; /* Garante alinhamento à esquerda */
}
.card-campanha-preview, .card-campanha, .horario-bloco {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px #0001;
    padding: 18px 18px 14px 18px;
    min-width: 220px;
    max-width: 220px;
    text-align: center;
    margin-bottom: 12px;
}
.card-campanha,
.horario-bloco {
    width: 410px;
    max-width: 98vw;
    margin: 0;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px #0001;
    padding: 28px 28px 22px 28px;
    box-sizing: border-box;
    text-align: left;
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

/* Títulos e seções internas */
.card-campanha > strong,
.horario-bloco > .linha-campos > div > strong {
    font-size: 1.11em;
    margin-bottom: 10px;
}

.linha-campos {
    display: flex;
    flex-wrap: wrap;
    gap: 16px 24px;
    align-items: center;
    margin-bottom: 8px;
    width: 100%;
}
.linha-campos > div,
.linha-campos > label {
    min-width: 95px;
    display: flex;
    flex-direction: column;
    font-size: 1em;
}

/* Inputs pequenos lado a lado */
.linha-campos > div {
    min-width: 0;
    flex: 1 1 110px;
    margin-right: 12px;
}
.linha-campos input[type="time"],
.linha-campos input[type="number"] {
    width: 100%;
    max-width: 110px;
    padding: 5px 8px;
    border: 1px solid #d3d9e5;
    border-radius: 5px;
    font-size: 1em;
    background: #f8fafc;
    margin-top: 2px;
}
.linha-campos label {
    font-weight: 500;
    margin-bottom: 2px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Switch elegante para Estática */
.switch-estatica {
    appearance: none;
    width: 36px;
    height: 20px;
    background: #d3d9e5;
    border-radius: 12px;
    position: relative;
    outline: none;
    cursor: pointer;
    transition: background 0.2s;
    vertical-align: middle;
    margin-left: 6px;
}
.switch-estatica:checked {
    background: #1abc9c;
}
.switch-estatica::before {
    content: "";
    position: absolute;
    left: 3px;
    top: 3px;
    width: 14px;
    height: 14px;
    background: #fff;
    border-radius: 50%;
    transition: left 0.2s;
}
.switch-estatica:checked::before {
    left: 19px;
}
.form-group {
    margin-bottom: 14px;
    width: 100%;
}
.form-group label {
    font-weight: 500;
}

/* Imagens agrupadas lado a lado */
.imagens-horario,
.imagens-enviadas {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 12px;
    margin-top: 10px;
}
.img-checkbox,
.img-enviada {
    background: #f5f6fa;
    border: 1px solid #ececec;
    padding: 9px 7px 5px 7px;
    border-radius: 6px;
    width: 115px;
    box-sizing: border-box;
    text-align: center;
    margin-bottom: 0;
    min-height: 152px;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.img-checkbox {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-right: 8px;
    font-size: 13px;
    background: #f8fafc;
    border-radius: 6px;
    padding: 8px 10px 6px 10px;
    border: 1px solid #e0e6ed;
    transition: box-shadow 0.2s;
}
.img-checkbox input[type="checkbox"] {
    margin-bottom: 4px;
}
.img-thumb {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #eee;
    margin-bottom: 6px;
    background: #fafbfc;
}
.img-label {
    margin-top: 4px;
    color: #444;
    font-size: 14px;
    word-break: break-word;
}

/* Botões do card */
.botoes-horario {
    margin-top: 18px;
    display: flex;
    gap: 14px;
    width: 100%;
}
.botoes-horario .btn-save, 
.botoes-horario .btn-delete {
    min-width: unset;
}

/* Dias da semana como botões */
.dias-semana-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 10px;
    margin-bottom: 10px;
}
.dia-checkbox {
    display: flex;
    align-items: center;
    gap: 4px;
    background: #f1f4fa;
    border: 1px solid #d3d9e5;
    border-radius: 16px;
    padding: 3px 14px 3px 8px;
    font-size: 15px;
    cursor: pointer;
    transition: background 0.18s, border 0.18s;
    user-select: none;
}
.dia-checkbox input[type="checkbox"] {
    accent-color: #3A5A75;
    margin-right: 3px;
}
.dia-checkbox input[type="checkbox"]:checked + span {
    font-weight: bold;
    color: #1abc9c;
}

/* Bloco de texto editável com borda pontilhada */
.text-draggable {
    position: absolute;
    background: rgba(0,0,0,0.0);
    color: #fff;
    font-weight: bold;
    cursor: move;
    z-index: 10001;
    user-select: none;
    text-align: left;
    pointer-events: auto;
    box-sizing: border-box;
    border: 2px dashed #3A5A75 !important; /* Borda pontilhada sempre visível */
    border-radius: 8px;
    transition: border-color 0.2s;
}

/* Handle de resize mais visível e maior */
.resize-handle {
    position: absolute;
    right: 0; bottom: 0;
    width: 28px; height: 28px;
    background: #fff;
    border: 2px solid #3A5A75;
    border-radius: 6px;
    cursor: se-resize;
    z-index: 2;
    box-shadow: 0 2px 6px #0002;
    display: flex;
    align-items: center;
    justify-content: center;
}
.resize-handle:after {
    content: "";
    display: block;
    width: 14px;
    height: 14px;
    border-right: 3px solid #3A5A75;
    border-bottom: 3px solid #3A5A75;
    border-radius: 2px;
    transform: rotate(15deg);
    margin-right: 2px;
    margin-bottom: 2px;
}

/* Responsivo */
@media (max-width: 1100px) {
    .campanha-cards-container {
        flex-direction: column;
        gap: 18px;
        align-items: center;
    }
    .card-campanha, .horario-bloco {
        width: 98vw;
        max-width: 440px;
        min-width: unset;
    }
}

.btn-close-modal {
    position: absolute;
    top: 8px;
    right: 12px;
    font-size: 1.5em;
    background: #3A5A75;
    color: #fff;
    border: none;
    border-radius: 6px;
    width: 38px;
    height: 38px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10002;
    transition: background 0.2s;
}
.btn-close-modal:hover {
    background: #27415a;
}
.form-campanha-editor {
    margin-top: 12px;
    display: flex;
    gap: 18px;
    justify-content: flex-start;
    align-items: flex-end;
}
.form-campanha-editor label {
    font-size: 14px;
    font-weight: 500;
    color: #222;
    margin-bottom: 6px;
    display: block;
}
.input-campanha, .form-campanha-editor select, .form-campanha-editor textarea {
    border: 1px solid #d3d9e5;
    border-radius: 5px;
    padding: 7px 10px;
    font-size: 15px;
    background: #f8fafc;
    color: #222;
    margin-bottom: 6px;
    width: 100%;
    box-sizing: border-box;
    transition: border 0.2s;
}
.input-campanha:focus, .form-campanha-editor select:focus, .form-campanha-editor textarea:focus {
    border: 1.5px solid #3A5A75;
    outline: none;
}
.input-color-campanha {
    width: 100%;
    padding: 7px 10px;
    border: 1px solid #d3d9e5;
    border-radius: 5px;
    font-size: 15px;
    background: #f8fafc;
    color: #222;
    margin-bottom: 6px;
    box-sizing: border-box;
    transition: border 0.2s;
}
.input-color-campanha:focus {
    border: 1.5px solid #3A5A75;
    outline: none;
}

/* Estilos do Modal Editor */
#modal-editor {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: rgba(0,0,0,0.7);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: auto; /* Permite rolagem do modal */
}

#modal-editor > div {
    background: #fff;
    padding: 24px;
    border-radius: 8px;
    max-width: 1100px;
    width: 98vw;
    position: relative;
    max-height: 96vh;
    overflow-y: auto; /* Permite rolagem interna do conteúdo */
    box-sizing: border-box;
}