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

:root {
    --primary-color: #2E92CF;
    --secondary-color: #764ba2;
    --navbar-background: rgb(3, 127, 155); /* #2E92CF; */
    --navbar-text-color: white;
    --content-background: white;
    --header-background: linear-gradient(135deg, #2E92CF 0%, #764ba2 100%);
    --navbar-height: 60px;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
}

/* Navbar */
.navbar {
    background: var(--navbar-background);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    position: sticky;
    top: 0;
    z-index: 999;
}

.navbar-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    /*    padding: 0 10px; */
}

.navbar-brand {
    color: white;
    font-size: 1.5em;
    font-weight: bold;
    /*    padding: 10px 0; */
}

.navbar-menu {
    list-style: none;
    display: flex;
    gap: 10px;
    margin: 0;
}

.nav-link {
    color: white;
    text-decoration: none;
    padding: 10px 10px;
    display: block;
    transition: all 0.3s;
    border-bottom: 3px solid transparent;
}

.nav-link:hover {
/*    background: rgba(255, 255, 255, 0.1); */
    border-bottom-color: var(--navbar-background);
    background-color:  lightgray;
    color: var(--navbar-background);
}

.nav-link.active {
/*    background: rgba(255, 255, 255, 0.15); */
    border-bottom-color: var(--navbar-background);
    background-color:  lightgray;
    color: var(--navbar-background);
}

/* Content Sections */
.content-section {
    display: none;
    height: 97% !important;
    min-height: 97% !important;
}

.content-section.active {
    display: block;
}

.main-section {
    height: calc(100vh - var(--navbar-height));
    min-height: calc(100vh - var(--navbar-height));
    max-height: calc(100vh - var(--navbar-height));
    width: calc(100vw);
    min-width: calc(100vw);
    max-width: calc(100vw);
    display: grid; 
    grid-template-rows: calc(100% - 32px) 32px; /* main content and footer */
}

.work-section {
/*    max-height: 100%;
    min-height: 100%;
    display: flex;
    max-width: 100%;
    height: 100%;
    width: 100%;*/
    overflow: auto;
    background-color: white;
    padding-top: 25px;
}

.container {
    max-width: 1400px;
    margin: 10px auto;
    background: white;
    border-radius: 10px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-height: 100%;
    height: 100%;
    min-height: 100%;
    overflow: hidden;
}

header {
    background: var(--header-background);
    color: white;
    padding: 40px;
    text-align: center;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

header p {
    font-size: 1.1em;
    opacity: 0.9;
}

/* Header minimalista para tables */
.header-table {
    color: black;
    background: white;
    padding: 5px 40px;
    text-align: left;
    min-height: auto;
    margin-top: 4px;
}

.header-table h2 {
    margin: 0;
    font-size: 1.5em;
    font-weight: 600;
}

main {
    padding: 0px;
}

/* Actions Section */
.actions-section {
    margin-bottom: 12px;
    margin-top: 12px;
    margin-right: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.search-container {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input {
    padding: 8px 35px 8px 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    width: 350px;
    transition: all 0.3s;
}

.search-input:focus {
    outline: none;
    border-color: var(--navbar-background);
    box-shadow: 0 0 5px rgba(46, 146, 207, 0.3);
}

.search-icon {
    position: absolute;
    right: 12px;
    color: #999;
    pointer-events: none;
}

/* TODO Section */
.todo-section {
    background: #fff3cd;
    border: 2px solid #ffc107;
    border-radius: 10px;
    padding: 40px;
    text-align: center;
    margin: 20px 0;
}

.todo-section h2 {
    color: #856404;
    margin-bottom: 15px;
}

.todo-section p {
    color: #856404;
    font-size: 1.1em;
}

/* Form */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 15px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: rgb(3, 127, 155) !important; /* #555; */
    font-weight: 600;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 8px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1em;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--navbar-background);
}

.form-group textarea {
    font-family: inherit;
    resize: vertical;
}

/* Mesma altura para todos os campos de linha única dos formulários */
.form-group input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]),
.form-group select {
    height: 46px;
}

.form-group input[type="date"] {
    font-family: Arial, sans-serif;
    font-size: 16px;
}

.company-modal,
.project-modal {
    overflow-y: auto;
}

.company-modal .modal-content {
    min-width: 1290px !important;
}

/* Opções com o glifo do ícone antes do nome (o texto cai para a fonte seguinte) */
#rotina_rotina_imagem,
#rotina_rotina_imagem option {
    font-family: "iconFont", Arial, sans-serif;
}

/* Perfis: controle de acesso */
.perfil-modal .modal-content {
    max-width: 900px;
}

.access-title {
    margin: 10px 0 14px;
    color: #333;
}

.access-module {
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 8px 16px;
    margin-bottom: 14px;
}

.access-row {
    display: grid;
    grid-template-columns: 1fr 160px;
    align-items: center;
    gap: 10px;
    padding: 5px 0;
}

.access-row.module {
    font-weight: 600;
}

.access-row.rotina {
    padding-left: 32px;
    color: #555;
}

.access-options label {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-right: 14px;
    font-weight: normal;
    cursor: pointer;
}

.access-options input[disabled] + span,
.access-options label.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Autocomplete */
.autocomplete-wrapper {
    position: relative;
}

.autocomplete-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 10;
    display: none;
    margin: 0;
    padding: 0;
    list-style: none;
    max-height: 220px;
    overflow-y: auto;
    background: #fff;
    border: 2px solid var(--navbar-background);
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.autocomplete-item,
.autocomplete-empty {
    padding: 10px 12px;
    cursor: pointer;
}

.autocomplete-empty {
    color: #999;
    cursor: default;
}

.autocomplete-item:hover,
.autocomplete-item.active {
    background: #e8f3fb;
}

/* Buttons */

button:focus {
	outline: 2px solid gray;
    outline-offset: -2px;
}

.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
    width: auto;
    max-width: 200px !important;
}

.btn-primary {
    background: rgb(3, 127, 155);
    color:  white; 
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px lightgray;
}

.btn-secondary {
    background: rgba(3, 127, 155, 0.4);
    color: rgb(3, 127, 155); 
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px lightgray;
}

/* Action Buttons in Table */
.btn-action {
    padding-top: 2px;
    padding-left: 6px;
    padding-right: 6px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
    margin: 0 3px;
}

.btn-edit {
    background: #ffc107;
    color: #333;
}

.btn-edit:hover {
    background: #e0a800;
    transform: scale(1.1);
}

.btn-delete {
    background: #dc3545;
    color: white;
}

.btn-delete:hover {
    background: #c82333;
    transform: scale(1.1);
}

/* Messages */
.message {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: none;
}

.message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    display: block;
}

.message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    display: block;
}

/* Users Section */
.users-section h2 {
    color: #333;
    margin-bottom: 20px;
}

/* Table Container */
.table-container {
    overflow-x: auto;
    margin-bottom: 30px;
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    visibility: hidden;
}

.table thead {
    color: black;
    font-weight: bold;
}

.table thead th {
    padding: 6px;
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
    border: 1px solid lightgray;
}

.table tbody td {
    padding: 4px;
    white-space: nowrap;
    border: 1px solid lightgray;
}

.table.striped tbody tr:nth-child(even) {
    background: #f8f9fa;
}

.table.hovered tbody tr:hover {
    background: #e9ecef;
}

.text-center {
    text-align: center;
}

/* Pagination */
.pagination {
    margin-top: 30px;
    padding-bottom: 10px;
}

.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-page {
    padding: 10px 15px;
    border: 2px solid var(--navbar-background);
    background: white;
    color: var(--navbar-background);
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
}

.btn-page:hover {
    background: var(--navbar-background);
    color: white;
}

.btn-page.active {
    background: var(--navbar-background);
    color: white;
}

.pagination-ellipsis {
    color: #666;
    padding: 0 10px;
}

/* Form Buttons Container */
.form-buttons {
    display: flex;
    gap: 10px;
    margin-top: 3px;
    justify-content: center;
}

/* Footer */
footer {
    background: var(--navbar-background);
    color: white;
    text-align: center;
    padding: 5px;
    margin-bottom: 2px;
    margin-top: 8px;
    position: absolute;
    bottom: 0px;
    width: 100%;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 10px;
    border-radius: 10px;
    width: 90%;
    position: relative;
    width: auto;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: #000;
}

.modal-content h2 {
    margin-bottom: 20px;
    color: rgb(3, 127, 155);
}

/* Responsive */
@media (max-width: 768px) {
    header h1 {
        font-size: 1.8em;
    }

    main {
        padding: 0px;
    }

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

    .actions-section {
        flex-direction: column;
    }

    .navbar-container {
        flex-direction: column;
        gap: 10px;
    }

    .navbar-menu {
        flex-wrap: wrap;
    }

    .table-container {
        font-size: 0.9em;
    }
}

.loading {
    text-align: center;
    color: #666;
    font-style: italic;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: white;
    margin: 10% auto;
    padding: 10px;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    position: relative;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: #000;
}

#icons-list,
#icons-list-empresas,
#icons-list-projetos,
#icons-list-perfis,
#icons-list-usuarios,
#icons-list-rotinas {
    display: flex;
    gap: 15px;
    margin-left: 15px;
}

a,
.link {
    font-family: 'Segoe UI', 'Open Sans', Verdana, Arial, Helvetica, sans-serif;
    font-weight: 400;
    font-size: 11pt;
    font-smooth: always;
    line-height: 13pt;
    color: var(--navbar-background);
    text-decoration: none;
}

a:hover,
.link:hover {
/*    color: rgba(45, 173, 237, 0.8); */
    background-color:  lightgray;
    color: var(--navbar-background);
}

a:active,
.link:active {
    color: rgba(45, 173, 237, 0.6);
}

@media (max-width: 768px) {
    header h1 {
        font-size: 1.8em;
    }

    main {
        padding: 0px;
    }

    .users-list {
        grid-template-columns: 1fr;
    }
}

.dropdown_projeto-content {
    display: none;
    position: absolute;
    background-color: white;
    min-width: 180px;
    box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
    border: 1px solid lightgray;
    padding: 12px 16px;
}

.dropdown_projeto-content span {
    float: none;
    padding: 6px 6px;
    text-decoration: none;
    display: block;
    text-align: left;
    background-color: white;
    color: rgb(46, 146, 207);
}

.dropdown_projeto-content span:hover {
    background-color: lightgray;
    color: rgb(46, 146, 207);
}

.dropdown_projeto:hover .dropdown_projeto-content {
    display: block;
}

.dropdown_config-content {
    display: none;
    position: absolute;
    background-color: var(--navbar-background);
    min-width: 180px;
    box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
    border: 1px solid lightgray;
    padding: 12px 16px;
    color: white;
    top: 98%;
}

.dropdown_config-content span {
    float: none;
    padding: 6px 6px;
    text-decoration: none;
    display: block;
    text-align: left;
    background-color: var(--navbar-background);
    color: white;
}

.dropdown_config-content span:hover {
    background-color: lightgray;
    color: var(--navbar-background);
}

.dropdown_config:hover .dropdown_config-content {
    display: block;
}

/* Navbar sem módulos liberados */
.no-access {
    padding: 30px 10px;
    color: #666;
    text-align: center;
    font-size: 1.1em;
}

/* Visualização: campos somente leitura, legíveis e sem botão Salvar */
.modal.view-mode input:disabled,
.modal.view-mode select:disabled,
.modal.view-mode textarea:disabled {
    background: #f7f7f7;
    color: #222;
    opacity: 1;
    cursor: default;
    -webkit-text-fill-color: #222;
}

/* Anexos */
.anexos-modal .modal-content {
    max-width: 900px;
}

.anexos-modal .table {
    visibility: visible;
}

.anexos-toolbar {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 14px;
}

.anexos-toolbar .btn {
    flex: 0 0 auto;
    padding-left: 18px;
    padding-right: 18px;
}

.anexos-hint {
    color: #777;
    font-size: 0.9em;
}

/* Modais de edição: título e botões ficam sempre visíveis; só os dados rolam */
.modal .modal-content {
    display: flex;
    flex-direction: column;
    max-height: 92vh;
    margin: 4vh auto;
}

.modal .modal-content > h2 {
    flex: 0 0 auto;
}

.modal .modal-content > form {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding-right: 6px;
}

.modal .modal-content .form-buttons {
    position: sticky;
    bottom: 0;
    z-index: 1;
    margin-top: 0;
    padding-top: 14px;
    background: #fff;
    border-top: 1px solid #eee;
}


