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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 40px 20px;
    color: #333;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: #ffffff;
    padding: 32px;
    text-align: center;
    position: relative;
}

.header-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.header-logo {
    width: 50px;
    height: 50px;
    object-fit: contain;
    border-radius: 50%;
    background: #ffffff;
    padding: 3px;
}

.header-titles {
    text-align: left;
}

.hidden {
    display: none !important;
}

.auth-tabs {
    display: flex;
    padding: 0 32px;
    margin-top: 24px;
    border-bottom: 2px solid #e5e7eb;
}

.auth-tab {
    flex: 1;
    padding: 14px;
    border: none;
    background-color: #f3f4f6;
    color: #6b7280;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}

.auth-tab.active {
    background-color: #ffffff;
    color: #4f46e5;
    border-bottom: 2px solid #4f46e5;
    margin-bottom: -2px;
}

.auth-form {
    padding: 32px;
}

.auth-form .field-group {
    margin-bottom: 20px;
}

.auth-form-title {
    font-size: 20px;
    color: #1f2937;
    margin-bottom: 12px;
    text-align: center;
}

.auth-form-descricao {
    font-size: 14px;
    color: #6b7280;
    text-align: center;
    margin-bottom: 20px;
    line-height: 1.5;
}

.auth-links {
    text-align: center;
    margin-top: 16px;
}

.link-esqueci-senha,
.link-voltar-login {
    background: none;
    border: none;
    color: #4f46e5;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
}

.link-esqueci-senha:hover,
.link-voltar-login:hover {
    text-decoration: underline;
}

.btn-full {
    width: 100%;
}

.btn-small {
    padding: 8px 16px;
    font-size: 14px;
}

.user-info {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
    font-size: 14px;
    flex-wrap: wrap;
}

#usuarioLogado {
    opacity: 0.95;
}

body.modo-modulo #btnLogout {
    display: none !important;
}

header h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
}

.subtitle {
    font-size: 16px;
    opacity: 0.9;
}

form {
    padding: 32px;
}

.form-section {
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid #e5e7eb;
}

.form-section:last-of-type {
    border-bottom: none;
}

.section-title {
    font-size: 20px;
    color: #4f46e5;
    margin-bottom: 20px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e0e7ff;
}

.section-label {
    display: block;
    font-size: 16px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
}

.music-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.music-row:last-child {
    margin-bottom: 0;
}

.field-group {
    display: flex;
    flex-direction: column;
}

.field-group label {
    font-size: 14px;
    font-weight: 600;
    color: #4b5563;
    margin-bottom: 6px;
}

.field-group input {
    padding: 12px 14px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 15px;
    transition: border-color 0.2s, box-shadow 0.2s;
    background-color: #fafafa;
}

.field-group input:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
    background-color: #ffffff;
}

.responsaveis-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 24px;
    flex-wrap: wrap;
}

.btn {
    padding: 14px 28px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-primary {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: #ffffff;
}

.btn-secondary {
    background-color: #f3f4f6;
    color: #374151;
}

.btn-secondary:hover {
    background-color: #e5e7eb;
}

.mensagem {
    margin: 0 32px 32px;
    padding: 14px;
    border-radius: 8px;
    text-align: center;
    font-weight: 500;
    display: none;
}

.mensagem.sucesso {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
    display: block;
}

.mensagem.erro {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
    display: block;
}

.dashboard {
    padding: 32px;
}

.dashboard-title {
    font-size: 22px;
    color: #1f2937;
    margin-bottom: 24px;
    text-align: center;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.dashboard-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 32px 24px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    background-color: #ffffff;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.dashboard-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    border-color: #4f46e5;
}

.dashboard-icon {
    font-size: 40px;
}

.dashboard-label {
    font-size: 16px;
    font-weight: 600;
    color: #374151;
    text-align: center;
}

.modulo-container {
    padding: 32px;
}

.modulo-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.modulo-title {
    font-size: 22px;
    color: #4f46e5;
}

.modulo-conteudo {
    background-color: #f9fafb;
    border-radius: 8px;
    padding: 32px;
    text-align: center;
}

.modulo-info {
    color: #6b7280;
    font-size: 16px;
    line-height: 1.6;
}

textarea {
    padding: 12px 14px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.2s, box-shadow 0.2s;
    background-color: #fafafa;
}

textarea:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
    background-color: #ffffff;
}

input[type="file"] {
    padding: 10px 0;
    font-size: 15px;
}

input[type="time"] {
    padding: 11px 14px;
}

input[type="color"] {
    width: 100%;
    height: 48px;
    padding: 4px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    background-color: #ffffff;
}

select {
    padding: 12px 14px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 15px;
    background-color: #fafafa;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
    width: 100%;
}

select:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
    background-color: #ffffff;
}

.imagem-preview {
    margin-top: 12px;
    max-width: 300px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid #e5e7eb;
}

.imagem-preview img {
    width: 100%;
    height: auto;
    display: block;
}

.anuncios-salvos {
    padding: 32px;
    border-top: 2px solid #e5e7eb;
    background-color: #f9fafb;
}

.musicas-salvas {
    padding: 32px;
    border-top: 2px solid #e5e7eb;
    background-color: #f9fafb;
}

.ensaios-salvos {
    padding: 32px;
    border-top: 2px solid #e5e7eb;
    background-color: #f9fafb;
}

.biblioteca-filtro {
    padding: 24px 32px;
    border-bottom: 1px solid #e5e7eb;
}

.nenhum-anuncio {
    text-align: center;
    color: #6b7280;
    font-style: italic;
    padding: 16px;
}

.anuncios-lista {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.anuncio-item {
    background-color: #ffffff;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.anuncio-imagem {
    width: 100%;
    max-height: 300px;
    object-fit: cover;
    display: block;
}

.anuncio-texto {
    padding: 16px 20px;
    color: #374151;
    line-height: 1.6;
    white-space: pre-wrap;
}

.anuncio-acoes {
    display: flex;
    justify-content: flex-end;
    padding: 12px 20px;
    border-top: 1px solid #e5e7eb;
    gap: 8px;
}

.nenhuma-musica {
    text-align: center;
    color: #6b7280;
    font-style: italic;
    padding: 16px;
}

.musicas-lista {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.musica-item {
    background-color: #ffffff;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    padding: 16px 20px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.musica-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.musica-titulo {
    font-size: 16px;
    font-weight: 700;
    color: #1f2937;
}

.musica-meta {
    font-size: 14px;
    color: #6b7280;
}

.musica-categoria {
    display: inline-block;
    background-color: #e0e7ff;
    color: #4f46e5;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 12px;
    margin-top: 4px;
    width: fit-content;
}

.musica-link {
    color: #4f46e5;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
}

.musica-link:hover {
    text-decoration: underline;
}

.nenhum-ensaio {
    text-align: center;
    color: #6b7280;
    font-style: italic;
    padding: 16px;
}

.ensaios-lista {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ensaio-item {
    background-color: #ffffff;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    flex-wrap: wrap;
}

.ensaio-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ensaio-data {
    font-size: 18px;
    font-weight: 700;
    color: #4f46e5;
}

.ensaio-horario {
    font-size: 14px;
    color: #6b7280;
}

.ensaio-local {
    font-size: 14px;
    color: #374151;
}

.ensaio-repertorio {
    font-size: 14px;
    color: #374151;
    font-style: italic;
}

.config-section {
    padding: 32px;
    border-bottom: 1px solid #e5e7eb;
}

.config-section:last-child {
    border-bottom: none;
}

.config-title {
    font-size: 18px;
    color: #1f2937;
    margin-bottom: 20px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e0e7ff;
}

.config-vazia {
    text-align: center;
    color: #6b7280;
    font-style: italic;
    padding: 16px;
}

.usuarios-lista {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.usuario-item {
    background-color: #f9fafb;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    padding: 14px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.usuario-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.usuario-nome {
    font-weight: 600;
    color: #1f2937;
}

.usuario-email {
    font-size: 14px;
    color: #6b7280;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 20px;
}

.modal-conteudo {
    background-color: #ffffff;
    border-radius: 12px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
}

.modal-title {
    font-size: 18px;
    color: #1f2937;
    margin: 0;
}

.btn-modal-fechar {
    background: none;
    border: none;
    font-size: 28px;
    color: #6b7280;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
}

.btn-modal-fechar:hover {
    color: #1f2937;
}

.modal form {
    padding: 24px;
}

.modal-acoes {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 8px;
}

.consulta-resultados {
    padding: 32px;
    border-top: 2px solid #e5e7eb;
    background-color: #f9fafb;
}

.consulta-vazia {
    text-align: center;
    color: #6b7280;
    font-style: italic;
    padding: 16px;
}

.consulta-lista {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.consulta-item {
    background-color: #ffffff;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.consulta-resumo {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

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

.consulta-data {
    font-size: 18px;
    color: #4f46e5;
    margin: 0;
}

.consulta-detalhes {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
}

.consulta-secao {
    font-size: 15px;
    font-weight: 700;
    color: #4f46e5;
    margin-top: 14px;
    margin-bottom: 6px;
    padding-bottom: 4px;
    border-bottom: 1px solid #e0e7ff;
}

.consulta-campo {
    color: #374151;
    font-size: 14px;
    line-height: 1.5;
}

.consulta-campo strong {
    color: #1f2937;
}

.consulta-link {
    color: #4f46e5;
    text-decoration: none;
    font-weight: 600;
    margin-left: 4px;
}

.consulta-link:hover {
    text-decoration: underline;
}

.planejamentos-salvos {
    padding: 32px;
    border-top: 2px solid #e5e7eb;
    background-color: #f9fafb;
}

.nenhum-planejamento {
    text-align: center;
    color: #6b7280;
    font-style: italic;
    padding: 16px;
}

.planejamentos-lista {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.planejamento-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #ffffff;
    padding: 16px 20px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.planejamento-data {
    font-weight: 600;
    color: #1f2937;
    font-size: 16px;
}

.planejamento-acoes {
    display: flex;
    gap: 8px;
}

.btn-acao {
    padding: 8px 14px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.2s;
}

.btn-acao:hover {
    transform: translateY(-1px);
}

.btn-carregar {
    background-color: #dbeafe;
    color: #1e40af;
}

.btn-carregar:hover {
    background-color: #bfdbfe;
}

.btn-excluir {
    background-color: #fee2e2;
    color: #991b1b;
}

.btn-excluir:hover {
    background-color: #fecaca;
}

@media (max-width: 768px) {
    body {
        padding: 20px 12px;
    }

    form {
        padding: 24px 20px;
    }

    .auth-tabs {
        padding: 0 20px;
    }

    .auth-form {
        padding: 24px 20px;
    }

    .music-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }

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

    .actions {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    .dashboard {
        padding: 24px 20px;
    }

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

    .dashboard-card {
        padding: 24px 20px;
    }

    .modulo-container {
        padding: 24px 20px;
    }

    .consulta-resultados {
        padding: 24px 20px;
    }

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

    .consulta-detalhes {
        grid-template-columns: 1fr;
    }

    .config-section {
        padding: 24px 20px;
    }

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

    .modal form {
        padding: 20px;
    }

    .modal-acoes {
        flex-direction: column;
    }

    .modulo-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .planejamentos-salvos,
    .anuncios-salvas,
    .musicas-salvas,
    .ensaios-salvos {
        padding: 24px 20px;
    }

    .biblioteca-filtro {
        padding: 20px;
    }

    .musica-item {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .musica-acoes {
        display: flex;
        justify-content: stretch;
    }

    .ensaio-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .ensaio-acoes {
        display: flex;
        width: 100%;
    }

    .ensaio-acoes .btn-acao {
        flex: 1;
    }

    .anuncio-acoes {
        justify-content: stretch;
    }

    .anuncio-acoes .btn-acao {
        flex: 1;
    }

    .planejamento-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .planejamento-acoes {
        width: 100%;
    }

    .btn-acao {
        flex: 1;
    }

    header h1 {
        font-size: 24px;
    }
}

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

@media print {
    body {
        background: #ffffff;
        padding: 0;
    }

    .container {
        box-shadow: none;
        max-width: 100%;
        border-radius: 0;
    }

    .actions,
    .mensagem,
    .planejamentos-salvos,
    .dashboard,
    .modulo-header,
    .user-info,
    header,
    #btnLogout,
    .btn,
    nav,
    #listaPlanejamentos {
        display: none !important;
    }

    #moduloPlanejamento {
        display: block !important;
    }

    #moduloPlanejamento.hidden {
        display: block !important;
    }

    #moduloPlanejamento form {
        padding: 0;
    }

    #moduloPlanejamento .form-section {
        break-inside: avoid;
        border-bottom: 1px solid #e5e7eb;
        margin-bottom: 20px;
        padding-bottom: 16px;
        page-break-inside: avoid;
    }

    #moduloPlanejamento .section-title {
        color: #1f2937;
        border-bottom: 2px solid #4f46e5;
        padding-bottom: 6px;
        margin-bottom: 14px;
        font-size: 18px;
    }

    #moduloPlanejamento .music-row {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 24px;
        margin-bottom: 12px;
        border: none;
    }

    #moduloPlanejamento .field-group {
        display: flex;
        flex-direction: column;
        gap: 4px;
    }

    #moduloPlanejamento label {
        font-weight: 700;
        color: #374151;
        font-size: 13px;
    }

    #moduloPlanejamento input,
    #moduloPlanejamento select,
    #moduloPlanejamento textarea {
        border: none;
        background: transparent;
        padding: 0;
        font-size: 14px;
        color: #000000;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    #moduloPlanejamento input::placeholder,
    #moduloPlanejamento select::placeholder,
    #moduloPlanejamento textarea::placeholder {
        color: transparent;
    }

    #moduloPlanejamento .section-label {
        font-size: 16px;
        font-weight: 700;
        color: #1f2937;
        margin-bottom: 8px;
    }

    #moduloPlanejamento #dataCulto {
        font-size: 16px;
        font-weight: 700;
    }
}
