
:root {
    --primary: #530d98;
    --primary-dark: #3f0876;
    --yellow: #febf4d;
    --bg: #f2f2f2;
    --text: #272238;
    --muted: #746d83;
    --border: #e8e1ef;
    --green: #2f9e61;
    --red: #dc3545;
    --light-blue: #7dd3fc;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 14px Inter, Segoe UI, Arial, sans-serif;
}

a {
    color: var(--primary);
    text-decoration: none;
}

button,
.primary {
    border: 0;
    border-radius: 9px;
    padding: 10px 14px;
    background: var(--primary);
    color: white;
    cursor: pointer;
    font-weight: 700;
    transition: 0.15s;
}

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

button:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.secondary {
    border: 1px solid #d9cbea;
    background: #fff;
    color: var(--primary);
}

.secondary:hover {
    background: #f5effa;
    color: var(--primary-dark);
}

.danger {
    background: var(--red) !important;
    color: #fff;
}

.ghost {
    padding: 7px 10px;
    font-size: 12px;
}

/* Estrutura principal */

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

aside {
    position: fixed;
    width: 245px;
    inset: 0 auto 0 0;
    background: linear-gradient(
        180deg,
        #2b0750 0%,
        #530d98 72%,
        #3f0876 100%
    );
    color: #f8f4ff;
    padding: 22px;
    display: flex;
    flex-direction: column;
    box-shadow: 8px 0 28px #2d075025;
}

.brand {
    height: 54px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 28px;
}

.brand img {
    width: 72px;
    height: auto;
    display: block;
}

.brand span {
    font-size: 12px;
    color: #e9ddf7;
    font-weight: 800;
    letter-spacing: 0.12em;
}

/* Menu de navegação */

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

nav a {
    padding: 11px 12px;
    border-radius: 9px;
    color: #f0e8f8;
    font-weight: 600;
}

nav a:hover {
    background: #ffffff1c;
    color: #fff;
}

nav hr {
    width: 100%;
    border: 0;
    border-top: 1px solid #ffffff2b;
    margin: 12px 0;
}

.me {
    margin-top: auto;
    background: #ffffff12;
    border: 1px solid #ffffff1c;
    border-radius: 11px;
    padding: 12px;
}

.me b,
.me small,
.me a {
    display: block;
}

.me small {
    color: #dccff0;
    margin: 3px 0 10px;
}

.me a {
    color: var(--yellow);
    font-weight: 700;
}

/* Cabeçalho e conteúdo */

main {
    margin-left: 245px;
    width: calc(100% - 245px);
    min-height: 100vh;
    background: var(--bg);
}

header {
    height: 90px;
    background: #f2f2f2;
    border-bottom: 1px solid var(--border);
    padding: 16px 32px;
}

header small {
    color: var(--primary);
    text-transform: uppercase;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 100%;
}

.header-brand img {
    width: 52px;
    height: auto;
}

.header-brand > span {
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.1em;
    color: var(--primary);
    margin-right: 10px;
}

.header-brand div {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

h1 {
    font-size: 25px;
    margin: 3px 0;
}

.content {
    padding: 28px 32px;
}

/* Cards e painéis */

.cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 20px;
}

.card,
.panel {
    background: white;
    border: 1px solid var(--border);
    border-radius: 13px;
    box-shadow: 0 4px 15px #2b123f0a;
}

.card {
    padding: 18px;
}

.card small {
    display: block;
    color: var(--muted);
}

.card b {
    display: block;
    font-size: 22px;
    margin-top: 8px;
}

.panel {
    padding: 20px;
    margin-bottom: 18px;
}

.panel-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.panel-heading h2 {
    margin: 0 0 4px;
}

.panel-heading p {
    margin: 0;
    color: var(--muted);
}

.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

/* Tabelas */

.table {
    overflow: auto;
    padding: 0;
}

.table table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 13px 15px;
    text-align: left;
    border-bottom: 1px solid #f0ebf4;
    white-space: nowrap;
}

.table th {
    font-size: 11px;
    color: var(--muted);
    text-transform: uppercase;
    background: #faf8fc;
}

.table small,
.row small {
    display: block;
    color: var(--muted);
    margin-top: 3px;
}

/* Formulários */

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

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

label {
    display: block;
    color: #514a61;
    font-weight: 700;
    font-size: 12px;
}

input,
select,
textarea {
    width: 100%;
    margin-top: 6px;
    border: 1px solid #d9d1e2;
    border-radius: 8px;
    padding: 10px;
    background: #fff;
    color: var(--text);
    font: inherit;
    outline: none;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px #530d9812;
}

textarea {
    min-height: 100px;
}

.form button {
    margin-top: 18px;
}

/* Banner de destaque */

.hero {
    background: linear-gradient(135deg, #530d98, #3e0875);
    color: #fff;
    padding: 22px;
    border-radius: 15px;
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 18px;
}

.hero h2 {
    margin: 5px 0;
}

.hero p {
    color: #eee5f7;
    max-width: 760px;
}

.hero select {
    width: auto;
}

.hero-top {
    display: flex;
    align-items: center;
    gap: 10px;
}

.hero-actions {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    flex-wrap: wrap;
}

/* Elementos em linha */

.inline {
    display: flex;
    gap: 7px;
    align-items: center;
}

.inline input,
.inline select {
    width: auto;
    margin: 0;
}

/* Listas e avisos */

.row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 11px 0;
    border-bottom: 1px solid #edf1f5;
}

.row:last-child {
    border: 0;
}

.row-actions {
    display: flex;
    gap: 7px;
    align-items: center;
}

.alert {
    padding: 11px;
    border-radius: 8px;
    margin-bottom: 14px;
}

.alert.success {
    background: #dcfce7;
    color: #166534;
}

.alert.danger {
    background: #fee2e2;
    color: #991b1b;
}

.notice {
    padding: 14px;
    border-radius: 9px;
    background: #fff7ed;
    color: #9a3412;
}

/* Cadastro rápido de cliente */

.quick-client {
    align-self: start;
}

.quick-client-row {
    display: flex;
    gap: 7px;
    margin-top: 6px;
}

.quick-client-row input {
    margin: 0;
}

.quick-client-row button {
    white-space: nowrap;
}

.quick-client small {
    display: block;
    color: var(--muted);
    margin-top: 6px;
}

/* Prioridades dos JOBs */

.priority-readonly {
    border: 1px dashed #d8cce5;
    border-radius: 9px;
    padding: 10px;
    background: #fbf9fd;
}

.priority-readonly span {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: #514a61;
}

.priority-readonly strong {
    display: inline-block;
    margin-top: 7px;
}

.priority-readonly small {
    display: block;
    color: var(--muted);
    margin-top: 5px;
}

.priority-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 5px 9px;
    font-size: 11px;
    font-weight: 800;
}

.priority-baixa {
    background: #d9f3ff;
    color: #12627d;
}

.priority-normal {
    background: #dcfce7;
    color: #176b3b;
}

.priority-alta {
    background: #fff1b8;
    color: #8a6200;
}

.priority-urgente {
    background: #fee2e2;
    color: #b42332;
}

/* JOBs no dashboard */

.job-dashboard-list {
    display: grid;
    gap: 2px;
    margin-top: 14px;
}

.job-dashboard-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 6px;
    border-bottom: 1px solid #f0ebf4;
    color: var(--text);
}

.job-dashboard-item:hover {
    background: #faf8fc;
    border-radius: 9px;
}

.job-priority-icon,
.priority-legend i {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    flex: 0 0 12px;
}

.job-dashboard-main {
    flex: 1;
}

.job-dashboard-main b {
    display: block;
}

.job-dashboard-main small {
    display: block;
    color: var(--muted);
    margin-top: 3px;
}

.priority-label {
    font-size: 12px;
    font-weight: 800;
    color: var(--muted);
}

.priority-legend {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
    margin-top: 15px;
    padding-top: 14px;
    border-top: 1px solid #eee8f2;
    color: var(--muted);
    font-size: 12px;
}

.priority-legend span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.priority-legend .priority-baixa {
    background: #78D0F5;
}

.priority-legend .priority-normal {
    background: #2DA465;
}

.priority-legend .priority-alta {
    background: #F4C51B;
}

.priority-legend .priority-urgente {
    background: #E6374B;
}

/* Tela de login */

.login {
    min-height: 100vh;
    display: grid;
    place-items: center;
    position: relative;
    background-image: url('../img/maos-una.jpeg');
    background-size: cover;
    background-position: center;
}

.login-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg,
        #2b0750cc,
        #530d9870 55%,
        #1f083880
    );
}

.login-card {
    position: relative;
    z-index: 1;
    width: min(430px, 92vw);
    background: #ffffffef;
    padding: 34px;
    border-radius: 18px;
    box-shadow: 0 25px 80px #19062d45;
    backdrop-filter: blur(6px);
}

.login-brand {
    display: flex;
    align-items: center;
    gap: 15px;
}

.login-brand img {
    width: 105px;
    height: auto;
}

.login-brand div {
    display: flex;
    flex-direction: column;
    line-height: 1;
}

.login-brand strong {
    font-size: 27px;
    color: var(--primary);
}

.login-brand span {
    font-size: 22px;
    color: #5e566a;
    margin-top: 6px;
}

.login-subtitle {
    color: var(--muted);
    margin: 16px 0 22px;
}

.login-card label {
    margin: 15px 0;
}

.login-card small {
    display: block;
    margin-top: 15px;
    color: var(--muted);
    line-height: 1.45;
}

.full-button {
    width: 100%;
    margin-top: 8px;
}

/* Responsividade para tablets */

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

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

    aside {
        width: 205px;
    }

    main {
        margin-left: 205px;
        width: calc(100% - 205px);
    }
}

/* Responsividade para celulares */

@media (max-width: 650px) {
    .app {
        display: block;
    }

    aside {
        position: static;
        width: 100%;
    }

    main {
        margin: 0;
        width: 100%;
    }

    .content {
        padding: 18px;
    }

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

    .hero {
        display: block;
    }

    .inline {
        flex-wrap: wrap;
    }

    .inline input,
    .inline select {
        width: 100%;
    }

    .hero-actions {
        margin-top: 15px;
    }

    .panel-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .quick-client-row {
        flex-direction: column;
    }
}

/* Botão para mostrar ou ocultar a senha */

.password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.password-wrapper input {
    width: 100%;
    padding-right: 45px;
}

.login-card .password-wrapper input {
    margin-top: 6px;
}

.toggle-password {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    padding: 5px;
    cursor: pointer;
    color: var(--muted);
    display: flex;
    align-items: center;
    justify-content: center;
}

.toggle-password:hover {
    background: transparent;
    color: var(--primary);
}

/* Divisórias da tabela de fornecedores */
.panel.table table {
    width: 100%;
    border-collapse: collapse;
}

.panel.table th,
.panel.table td {
    border-right: 1px solid var(--border, #e5deed);
    border-bottom: 1px solid var(--border, #e5deed);
    padding: 12px 14px;
    text-align: left;
}

.panel.table th:last-child,
.panel.table td:last-child {
    border-right: none;
}

.panel.table tbody tr:last-child td {
    border-bottom: none;
}
/* Cores das bolinhas de prioridade dos JOBs */
.job-priority-icon.priority-baixa {
    background-color: #78D0F5;
}

.job-priority-icon.priority-normal {
    background-color: #2DA465;
}

.job-priority-icon.priority-alta {
    background-color: #F4C51B;
}

.job-priority-icon.priority-urgente {
    background-color: #E6374B;
}
.client-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.client-actions .edit-button,
.client-actions .delete-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 36px;
    box-sizing: border-box;
    padding: 0;
    margin: 0;
    border-radius: 8px;
}

.client-actions .edit-button {
    text-decoration: none;
}

.client-actions form {
    width: 72px;
    height: 36px;
    margin: 0;
    padding: 0;
}

/* ========================================
   TABELA DE JOBS - PADRÃO UNA
   ======================================== */

.jobs-table-wrapper {
    width: 100%;
    overflow-x: auto;
    border: 1px solid #ded8e8;
    border-radius: 8px;
    background: #ffffff;
}

.jobs-table {
    width: 100%;
    min-width: 950px;
    border-collapse: collapse;
    font-size: 14px;
}

.jobs-table th,
.jobs-table td {
    padding: 12px 10px;
    border-right: 1px solid #ded8e8;
    border-bottom: 1px solid #ded8e8;
    text-align: left;
    vertical-align: middle;
    overflow-wrap: anywhere;
}

.jobs-table th {
    background: #f2edf8;
    color: #3f0876;
    font-weight: 700;
    text-align: center;
    border-bottom: 2px solid #c9b7df;
}

.jobs-table th:last-child,
.jobs-table td:last-child {
    border-right: none;
}

.jobs-table tbody tr:last-child td {
    border-bottom: none;
}

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

.jobs-table tbody tr:hover {
    background: #f1eafa;
}

/* Link do JOB */

.jobs-table .job-link {
    color: #530d98;
    text-decoration: none;
}

.jobs-table .job-link:hover {
    text-decoration: underline;
}

.jobs-table .job-name {
    display: block;
    margin-top: 4px;
    color: #746d83;
    font-size: 12px;
}

/* Coluna de ações */

.jobs-table .actions-cell {
    min-width: 100px;
    text-align: center;
    white-space: nowrap;
}

.job-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.job-actions .edit-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 36px;
    box-sizing: border-box;
    padding: 0;
    margin: 0;
    border-radius: 8px;
    text-decoration: none;
}

.job-actions form {
    width: 72px;
    height: 36px;
    margin: 0;
    padding: 0;
}

.job-actions .delete-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 36px;
    box-sizing: border-box;
    padding: 0;
    margin: 0;
    border-radius: 8px;
}

/* Mensagem de tabela vazia */

.jobs-empty {
    text-align: center !important;
    padding: 24px !important;
    color: #746d83;
}

/* ========================================
   TABELA DE FORNECEDORES
   ======================================== */

.suppliers-table-wrapper {
    width: 100%;
    overflow-x: auto;
    background: #ffffff;
    border: 1px solid #e8e2ef;
    border-radius: 12px;
    box-shadow: 0 3px 12px rgba(45, 20, 70, 0.05);
}

.suppliers-table {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
    text-align: left;
}

.suppliers-table thead {
    background: #f6f3fa;
}

.suppliers-table th {
    padding: 16px;
    color: #530d98;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    border-bottom: 1px solid #e8e2ef;
    white-space: nowrap;
}

.suppliers-table td {
    padding: 15px 16px;
    color: #272238;
    font-size: 14px;
    border-bottom: 1px solid #eeeaf3;
    vertical-align: middle;
}

.suppliers-table tbody tr {
    transition: background 0.2s ease;
}

.suppliers-table tbody tr:hover {
    background: #faf8fd;
}

.suppliers-table tbody tr:last-child td {
    border-bottom: none;
}

.supplier-name {
    font-weight: 600;
    color: #272238;
}

.suppliers-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.suppliers-actions form {
    margin: 0;
}

.suppliers-table .actions-cell {
    text-align: center;
    white-space: nowrap;
}

.suppliers-table .delete-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 7px 12px;
    border-radius: 7px;
    color: #b42318;
    background: #fff1f0;
    border: 1px solid #f5c2bf;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.suppliers-table .delete-button:hover {
    color: #ffffff;
    background: #b42318;
    border-color: #b42318;
}

.suppliers-empty {
    padding: 30px 16px !important;
    color: #746d83 !important;
    text-align: center;
    font-style: italic;
}

@media (max-width: 768px) {
    .suppliers-table {
        min-width: 650px;
    }

    .suppliers-table th,
    .suppliers-table td {
        padding: 12px;
    }
}

/* Busca e paginação das listas */
.list-search { margin-bottom: 14px; flex-wrap: wrap; }
.list-search input[name="q"] { min-width: 260px; flex: 1 1 260px; }
.list-search small { color: var(--muted); }
.list-pager { margin-top: 14px; }
