/* Identidade visual WAFI NET */
.task-login #logo {
    display: inline-block;
    position: relative;
    top: 16vh;
    max-height: 100px;
    max-width: 260px;
    width: auto;
    height: auto;
    object-fit: contain;
}

/* Botão de entrada WAFI NET */
#rcmloginsubmit {
    background: linear-gradient(90deg, #f0448b 0%, #ffad45 100%) !important;
    border: 0 !important;
    color: #ffffff !important;
    box-shadow: none;
}

#rcmloginsubmit:hover {
    background: linear-gradient(90deg, #df347a 0%, #f39a32 100%) !important;
}

#rcmloginsubmit:focus {
    box-shadow: 0 0 0 0.2rem rgba(240, 68, 139, 0.25) !important;
}

/* ========================================
   WAFI NET - Menu interno do webmail
   ======================================== */

#layout-menu {
    background: #25232f !important;
    border-right: 1px solid #393443 !important;
}

#layout-menu .popover-header {
    background: #25232f !important;
    border-bottom: 1px solid #393443 !important;
}

#taskmenu a {
    color: #eee9f1 !important;
    transition: background 0.2s ease, color 0.2s ease;
}

#taskmenu a.selected,
#taskmenu a.selected:hover {
    color: #ffffff !important;
    background: linear-gradient(110deg, #e9438b 0%, #f5a044 100%) !important;
}

#taskmenu a:hover,
#taskmenu a:focus {
    color: #ffffff !important;
    background: #393443 !important;
}

#taskmenu .action-buttons a {
    color: #ffffff !important;
    background: linear-gradient(110deg, #e9438b 0%, #f5a044 100%) !important;
    border-radius: 8px;
}

#taskmenu .action-buttons a:hover {
    background: linear-gradient(110deg, #d9367d 0%, #e99132 100%) !important;
}

#taskmenu .special-buttons {
    background: #25232f !important;
}

#taskmenu .special-buttons a {
    color: #d8d0df !important;
}

#taskmenu a.logout {
    color: #ff8b91 !important;
}

#taskmenu a.logout:hover {
    color: #ffffff !important;
    background: #713b4b !important;
}

#taskmenu a:focus-visible {
    outline: 2px solid #ffad45;
    outline-offset: -2px;
}

/* Menu em telas pequenas */
@media screen and (max-width: 480px) {
    #taskmenu a {
        border-bottom: 1px solid #393443 !important;
    }

    #taskmenu a.selected,
    #taskmenu a.selected:hover {
        background: linear-gradient(90deg, #e9438b 0%, #f5a044 100%) !important;
    }
}

/* ========================================
   WAFI NET - Lista de mensagens
   ======================================== */

/* Passagem do mouse */
.messagelist tr:not(.flagged):not(.deleted):hover td {
    background-color: #fff8fb !important;
}

/* Mensagem selecionada */
.messagelist tr:not(.flagged):not(.deleted).selected td {
    background-color: #fff0f5 !important;
}

.messagelist tr:not(.flagged):not(.deleted).selected td.subject a {
    color: #c83270 !important;
}

/* Indicador de mensagem não lida */
.messagelist td.subject span.msgicon.status.unread:before {
    color: #e9438b !important;
}

/* Anexos */
.messagelist span.attachment span {
    color: #c77b45;
}

/* Modo escuro */
html.dark-mode .messagelist tr:not(.flagged):not(.deleted):hover td {
    background-color: #302a34 !important;
}

html.dark-mode .messagelist tr:not(.flagged):not(.deleted).selected td {
    background-color: #493342 !important;
}

html.dark-mode .messagelist tr:not(.flagged):not(.deleted).selected td.subject a,
html.dark-mode .messagelist tr:not(.flagged):not(.deleted).selected td.subject span.msgicon.status {
    color: #ff9ac1 !important;
}

html.dark-mode .messagelist tr:not(.flagged):not(.deleted) td.subject span.msgicon.status.unread:before {
    color: #ffad45 !important;
}

html.dark-mode .messagelist span.attachment span {
    color: #d9a078;
}

/* ========================================
   WAFI NET - Tela de leitura de mensagens
   ======================================== */

/* Área do cabeçalho */
#message-header {
    padding: 1.25rem;
    margin-bottom: 1.25rem;
    background: #ffffff;
    border: 1px solid #eee7ed;
    border-radius: 12px;
}

/* Assunto */
#message-header > .subject {
    color: #302b36;
    padding-bottom: 0.85rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid #f1e8ee;
}

/* Foto e informações do remetente */
#message-header > .header img.contactphoto {
    border: 2px solid #f5dce8;
}

#message-header .header-summary {
    color: #45404a;
}

#message-header .header-headers .header-title {
    color: #a34d76;
}

/* Links de detalhes e cabeçalhos */
#message-header .header-links a {
    color: #d43e7d;
}

#message-header .header-links a:hover {
    color: #a92d64;
}

/* Cabeçalhos internos de mensagens */
.message-partheaders {
    background: #fff8fb;
    border-top: 1px solid #f2dce7;
    border-radius: 8px 8px 0 0;
}

.message-partheaders table.headers-table {
    color: #5d5360;
}

.message-partheaders table.headers-table .header-title {
    color: #a34d76;
}

/* Lista de anexos */
#message-content .attachmentslist:not(:empty) {
    padding: 0.5rem;
    background: #fff8fb;
    border: 1px solid #f1dce6;
    border-radius: 8px;
}

.attachmentslist li:before {
    color: #e9438b;
}

.attachmentslist li a {
    color: #a9346b;
}

.attachmentslist li a:hover {
    color: #e9438b;
}

/* Modo escuro */
html.dark-mode #message-header {
    background: #302a34;
    border-color: #493d4b;
}

html.dark-mode #message-header > .subject {
    color: #f4eaf1;
    border-bottom-color: #493d4b;
}

html.dark-mode #message-header .header-summary {
    color: #e5dce5;
}

html.dark-mode #message-header .header-headers .header-title {
    color: #ff9ac1;
}

html.dark-mode #message-header .header-links a {
    color: #ff9ac1;
}

html.dark-mode .message-partheaders {
    background: #302a34;
    border-color: #493d4b;
}

html.dark-mode .message-partheaders table.headers-table {
    color: #e5dce5;
}

html.dark-mode .message-partheaders table.headers-table .header-title {
    color: #ff9ac1;
}

html.dark-mode #message-content .attachmentslist:not(:empty) {
    background: #302a34;
    border-color: #493d4b;
}

html.dark-mode .attachmentslist li:before {
    color: #ff9ac1;
}

html.dark-mode .attachmentslist li a {
    color: #ffb2d0;
}


/* ========================================
   WAFI NET - Composição de mensagens
   ======================================== */

/* Área dos campos */
#compose-content {
    padding-bottom: 1.5rem;
}

#compose-headers {
    padding: 1rem;
    background: #ffffff;
    border: 1px solid #eee7ed;
    border-radius: 12px;
    margin-bottom: 1rem;
}

#compose-headers .col-form-label {
    color: #6b5362;
    font-weight: 600;
}

/* Campos de texto */
#compose-content .form-control {
    border-color: #e6dce3;
    border-radius: 7px;
}

#compose-content .form-control:focus {
    border-color: #e9438b;
    box-shadow: 0 0 0 0.2rem rgba(233, 67, 139, 0.16);
}

/* Destinatários */
#compose-content .recipient-input {
    border-color: #e6dce3;
    border-radius: 7px;
}

#compose-content .recipient-input.focus {
    border-color: #e9438b;
    box-shadow: 0 0 0 0.2rem rgba(233, 67, 139, 0.16);
}

#compose-content .recipient-input li.recipient {
    background: #fff0f5;
    border-color: #f1c9dc;
    border-radius: 6px;
}

#compose-content .recipient-input li.recipient .name {
    color: #96365f;
}

#compose-content .recipient-input li.recipient a.button.icon {
    color: #b83b72;
}

/* Editor da mensagem */
#composebodycontainer {
    margin-top: 1rem;
}

#composebodycontainer > textarea,
#composebodycontainer > .form-control {
    border: 1px solid #e6dce3;
    border-radius: 8px;
    min-height: 22rem;
}

#composebodycontainer .html-editor > iframe {
    border: 1px solid #e6dce3;
    border-radius: 8px;
}

/* Barra do editor HTML */
#composebodycontainer .html-editor .editor-toolbar {
    background: #fff5f9;
    border-color: #f1dce6;
}

/* Botão enviar */
#compose-content .formbuttons button.send {
    background: linear-gradient(110deg, #e9438b 0%, #f5a044 100%) !important;
    border: 0 !important;
    border-radius: 8px;
    color: #ffffff !important;
    font-weight: 600;
    padding: 0.65rem 1.5rem;
    box-shadow: 0 3px 8px rgba(180, 65, 115, 0.16);
}

#compose-content .formbuttons button.send:hover {
    background: linear-gradient(110deg, #d9367d 0%, #e99132 100%) !important;
}

#compose-content .formbuttons button.send:focus {
    box-shadow: 0 0 0 0.2rem rgba(233, 67, 139, 0.22) !important;
}

/* Anexos e opções */
#layout-sidebar #compose-attachments,
#layout-sidebar #compose-options {
    border-color: #f1dce6;
}

#layout-sidebar #compose-attachments .btn-secondary {
    border-color: #e9b5ce;
    color: #a9346b;
}

/* Modo escuro */
html.dark-mode #compose-headers {
    background: #302a34;
    border-color: #493d4b;
}

html.dark-mode #compose-headers .col-form-label {
    color: #e5dce5;
}

html.dark-mode #compose-content .form-control {
    border-color: #574957;
}

html.dark-mode #compose-content .form-control:focus {
    border-color: #ff9ac1;
    box-shadow: 0 0 0 0.2rem rgba(255, 154, 193, 0.16);
}

html.dark-mode #compose-content .recipient-input.focus {
    border-color: #ff9ac1;
}

html.dark-mode #compose-content .recipient-input li.recipient {
    background: #493342;
    border-color: #765066;
}

html.dark-mode #compose-content .recipient-input li.recipient .name {
    color: #ffd5e6;
}

html.dark-mode #compose-content .recipient-input li.recipient a.button.icon {
    color: #ffb2d0;
}

html.dark-mode #composebodycontainer .html-editor .editor-toolbar {
    background: #39313d;
    border-color: #574957;
}

html.dark-mode #composebodycontainer .html-editor > iframe {
    border-color: #574957;
}

html.dark-mode #layout-sidebar #compose-attachments,
html.dark-mode #layout-sidebar #compose-options {
    border-color: #574957;
}


/* ========================================
   WAFI NET - Acabamento geral
   ======================================== */

/* Contatos: listas, painéis e cabeçalhos */
.task-addressbook #layout-list .header,
.task-addressbook #layout-sidebar .header,
.task-addressbook #layout-content > .header {
    border-bottom: 1px solid #f1dce6;
}

.task-addressbook #layout-list .header-title,
.task-addressbook #layout-sidebar .header-title,
.task-addressbook #layout-content .header-title {
    color: #96365f;
    font-weight: 600;
}

.task-addressbook #contacts-table tr:hover td {
    background-color: #fff8fb;
}

.task-addressbook #contacts-table tr.selected td {
    background-color: #fff0f5;
}

.task-addressbook #contacts-table tr.selected {
    color: #96365f;
}

.task-addressbook #contact-details .form-control:focus {
    border-color: #e9438b;
    box-shadow: 0 0 0 0.2rem rgba(233, 67, 139, 0.16);
}

.task-addressbook .formbuttons .btn-primary,
.task-addressbook #searchmenu .btn-primary {
    background: linear-gradient(110deg, #e9438b 0%, #f5a044 100%);
    border: 0;
    color: #fff;
}

/* Configurações: menu e área de conteúdo */
.task-settings #layout-sidebar .header,
.task-settings #layout-list .header,
.task-settings #layout-content > .header {
    border-bottom: 1px solid #f1dce6;
}

.task-settings #settings-menu a {
    border-radius: 7px;
    transition: background 0.2s ease, color 0.2s ease;
}

.task-settings #settings-menu a.selected,
.task-settings #settings-menu a.selected:hover {
    color: #96365f;
    background: #fff0f5;
}

.task-settings #settings-menu a:hover {
    background: #fff8fb;
}

.task-settings #layout-content .iframe-wrapper {
    background: #ffffff;
}

/* Menus flutuantes e pop-ups */
.popupmenu,
.menu,
.dropdown-menu {
    border-color: #eadde5;
    border-radius: 8px;
    box-shadow: 0 6px 22px rgba(50, 35, 47, 0.12);
}

.popupmenu a:hover,
.dropdown-menu a:hover,
.menu a:hover {
    background-color: #fff0f5;
    color: #96365f;
}

/* Janelas, diálogos e notificações */
.ui-dialog,
.modal-content,
.frame-content {
    border-color: #eadde5;
    border-radius: 10px;
}

.ui-dialog .ui-dialog-titlebar,
.modal-header {
    border-bottom-color: #f1dce6;
}

.ui-dialog .ui-dialog-buttonpane,
.modal-footer {
    border-top-color: #f1dce6;
}

#messagestack .notice,
#messagestack .confirmation {
    border-left: 3px solid #e9438b;
    border-radius: 6px;
}

/* Modo escuro: contatos e configurações */
html.dark-mode .task-addressbook #layout-list .header,
html.dark-mode .task-addressbook #layout-sidebar .header,
html.dark-mode .task-addressbook #layout-content > .header,
html.dark-mode .task-settings #layout-sidebar .header,
html.dark-mode .task-settings #layout-list .header,
html.dark-mode .task-settings #layout-content > .header {
    border-bottom-color: #493d4b;
}

html.dark-mode .task-addressbook .header-title,
html.dark-mode .task-settings .header-title {
    color: #ffb2d0;
}

html.dark-mode .task-addressbook #contacts-table tr:hover td {
    background-color: #302a34;
}

html.dark-mode .task-addressbook #contacts-table tr.selected td {
    background-color: #493342;
}

html.dark-mode .task-settings #settings-menu a.selected,
html.dark-mode .task-settings #settings-menu a.selected:hover {
    color: #ffd5e6;
    background: #493342;
}

html.dark-mode .task-settings #settings-menu a:hover {
    background: #39313d;
}

html.dark-mode .task-settings #layout-content .iframe-wrapper {
    background: #302a34;
}

html.dark-mode .popupmenu,
html.dark-mode .menu,
html.dark-mode .dropdown-menu,
html.dark-mode .ui-dialog,
html.dark-mode .modal-content,
html.dark-mode .frame-content {
    background-color: #302a34;
    border-color: #574957;
    color: #e5dce5;
}

html.dark-mode .popupmenu a:hover,
html.dark-mode .dropdown-menu a:hover,
html.dark-mode .menu a:hover {
    background-color: #493342;
    color: #ffd5e6;
}

html.dark-mode .ui-dialog .ui-dialog-titlebar,
html.dark-mode .modal-header {
    border-bottom-color: #574957;
}

html.dark-mode .ui-dialog .ui-dialog-buttonpane,
html.dark-mode .modal-footer {
    border-top-color: #574957;
}

/* Ajustes para celulares e tablets */
@media screen and (max-width: 768px) {
    #compose-headers {
        padding: 0.75rem;
        border-radius: 8px;
    }

    #message-header {
        padding: 0.85rem;
        border-radius: 8px;
    }

    .task-addressbook #layout-list .header-title,
    .task-settings #layout-list .header-title {
        max-width: 65%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .ui-dialog,
    .modal-dialog {
        max-width: calc(100% - 1rem);
    }
}

@media screen and (max-width: 480px) {
    #compose-content .formbuttons button.send {
        width: 100%;
    }

    .task-addressbook .formbuttons .btn-primary {
        width: 100%;
    }
}
