@import url('https://fonts.googleapis.com/css2?family=Rubik:wght@400;500;600;700;800&display=swap');

body.ajs-painel-fullscreen,
body.ajs-painel-fullscreen *,
.ajs-front-wrap,
.ajs-front-wrap * {
    font-family: 'Rubik', Arial, sans-serif !important;
}

html,
body {
    margin: 0 !important;
    padding: 0 !important;
    overflow-x: hidden;
    background: #f1f5f9;
}

body {
    font-family: Arial, sans-serif;
}

/* Ajuste quando a barra superior do WordPress estiver visível */
body.admin-bar .ajs-front-wrap {
    padding-top: 32px;
}

body.admin-bar .ajs-front-sidebar {
    padding-top: 56px;
}

body.admin-bar .ajs-front-main {
    padding-top: 56px;
}

@media (max-width: 782px) {
    body.admin-bar .ajs-front-wrap {
        padding-top: 46px;
    }

    body.admin-bar .ajs-front-sidebar {
        padding-top: 64px;
    }

    body.admin-bar .ajs-front-main {
        padding-top: 64px;
    }
}

/* Base geral */
.ajs-front-wrap,
.ajs-front-wrap * {
    box-sizing: border-box;
}

.ajs-front-wrap {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    width: 100vw;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    background: #f1f5f9;
    border-radius: 0;
    overflow: hidden;
font-family: 'Rubik', Arial, sans-serif;
color: #0f172a;
}

/* Sidebar */
.ajs-front-sidebar {
    background: #00205e;
    color: #ffffff;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 28px;
    min-height: 100vh;
}

.ajs-front-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ajs-front-logo {
    width: 46px;
    height: 46px;
    border-radius: 25px;
    background: #ffff00;
    color: #0f172a;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    letter-spacing: -0.5px;
    overflow: hidden;
    padding: 6px;
    flex: 0 0 46px;
}

.ajs-front-logo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.ajs-front-brand strong {
    display: block;
    font-size: 17px;
    line-height: 1.2;
}

.ajs-front-brand span {
    display: block;
    font-size: 12px;
    color: #cbd5e1;
    margin-top: 2px;
}

/* Navegação */
.ajs-front-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ajs-front-nav a {
    display: block;
    padding: 11px 13px;
    color: #cbd5e1 !important;
    text-decoration: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
}

.ajs-front-nav a:hover,
.ajs-front-nav a.active {
    background: rgba(255, 255, 255, 0.10);
    color: #ffffff !important;
}

/* Usuário logado */
.ajs-front-user {
    margin-top: auto;
    padding-top: 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.ajs-front-user small {
    display: block;
    color: #94a3b8;
    margin-bottom: 4px;
}

.ajs-front-user strong {
    display: block;
    margin-bottom: 10px;
}

.ajs-front-user a {
    color: #facc15 !important;
    text-decoration: none;
    font-weight: 600;
}

/* Área principal */
.ajs-front-main {
    padding: 28px;
    min-width: 0;
    min-height: 100vh;
}

.ajs-front-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
}

.ajs-front-header h1 {
    margin: 0;
    font-size: 28px;
    line-height: 1.2;
    color: #0f172a;
}

.ajs-front-header p {
    margin: 6px 0 0;
    color: #64748b;
}

/* Botões */
.ajs-front-btn,
.ajs-front-btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 11px 16px;
    background: #facc15;
    color: #0f172a !important;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    border: none;
    cursor: pointer;
    white-space: nowrap;
}

.ajs-front-btn-dark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 11px 16px;
    background: #0f172a;
    color: #ffffff !important;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    border: none;
    cursor: pointer;
    white-space: nowrap;
}

.ajs-front-btn-light {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 14px;
    background: #ffffff;
    color: #0f172a !important;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

/* Avisos */
.ajs-front-info {
    background: #e0f2fe;
    color: #075985;
    border: 1px solid #bae6fd;
    padding: 13px 15px;
    border-radius: 12px;
    margin-bottom: 18px;
    font-size: 14px;
}

.ajs-front-alert {
    padding: 16px;
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
    border-radius: 12px;
}

/* Login */
.ajs-front-login {
    max-width: 520px;
    margin: 40px auto;
    padding: 28px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
    font-family: 'Rubik', Arial, sans-serif;
}

.ajs-front-login h2 {
    margin: 0 0 10px;
    font-size: 24px;
    color: #0f172a;
}

.ajs-front-login p {
    margin: 0 0 20px;
    color: #64748b;
}

/* Cards */
.ajs-front-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.ajs-front-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 18px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.ajs-front-card span {
    display: block;
    color: #64748b;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
}

.ajs-front-card strong {
    display: block;
    color: #0f172a;
    font-size: 27px;
    line-height: 1.2;
    margin-bottom: 7px;
}

.ajs-front-card small {
    color: #94a3b8;
    font-size: 12px;
}

.ajs-front-card.success strong {
    color: #15803d;
}

.ajs-front-card.warning strong {
    color: #b45309;
}

.ajs-front-card.danger strong {
    color: #b91c1c;
}

.ajs-front-card.financial strong {
    font-size: 23px;
}

/* Painéis */
.ajs-front-panel {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    padding: 20px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.ajs-front-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 15px;
}

.ajs-front-panel-head h2 {
    margin: 0;
    font-size: 20px;
    color: #0f172a;
}

.ajs-front-panel-head a {
    color: #0f172a !important;
    font-weight: 600;
    text-decoration: none;
}

/* Tabelas */
.ajs-front-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.ajs-front-table {
    width: 100%;
    min-width: 840px;
    border-collapse: collapse;
    font-size: 14px;
}

.ajs-front-table th {
    text-align: left;
    color: #64748b;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 12px 10px;
    border-bottom: 1px solid #e2e8f0;
}

.ajs-front-table td {
    padding: 13px 10px;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
    vertical-align: middle;
}

.ajs-front-table td a {
    color: #0f172a !important;
    font-weight: 600;
    text-decoration: none;
}

/* Badges */
.ajs-front-badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 9px;
    background: #f1f5f9;
    color: #334155;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}

.ajs-front-badge.success {
    background: #dcfce7;
    color: #166534;
}

.ajs-front-badge.warning {
    background: #fef3c7;
    color: #92400e;
}

.ajs-front-badge.danger {
    background: #fee2e2;
    color: #991b1b;
}

.ajs-front-badge.info {
    background: #dbeafe;
    color: #1e40af;
}

/* Filtros */
.ajs-front-filters {
    display: grid;
    grid-template-columns: repeat(4, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.ajs-front-field label {
    display: block;
    color: #334155;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
}

.ajs-front-field input,
.ajs-front-field select,
.ajs-front-field textarea {
    width: 100%;
    min-height: 42px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    padding: 9px 11px;
    background: #ffffff;
    color: #0f172a;
    font-size: 14px;
    outline: none;
}

.ajs-front-field textarea {
    min-height: 96px;
    resize: vertical;
}

.ajs-front-field input:focus,
.ajs-front-field select:focus,
.ajs-front-field textarea:focus {
    border-color: #0f172a;
    box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.10);
}

/* Responsivo */
@media (max-width: 1100px) {
    .ajs-front-wrap {
        grid-template-columns: 1fr;
    }

    .ajs-front-sidebar {
        min-height: auto;
    }

    .ajs-front-nav {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ajs-front-user {
        margin-top: 0;
    }

    .ajs-front-cards {
        grid-template-columns: repeat(2, minmax(180px, 1fr));
    }

    .ajs-front-filters {
        grid-template-columns: repeat(2, minmax(160px, 1fr));
    }
}

@media (max-width: 700px) {
    .ajs-front-main {
        padding: 18px;
    }

    .ajs-front-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .ajs-front-cards {
        grid-template-columns: 1fr;
    }

    .ajs-front-nav {
        grid-template-columns: 1fr;
    }

    .ajs-front-filters {
        grid-template-columns: 1fr;
    }

    .ajs-front-wrap {
        border-radius: 0;
    }
}

/* Correção forte para evitar interferência do tema nos botões AJS */
.ajs-front-wrap button,
.ajs-front-wrap input[type="submit"],
.ajs-front-wrap input[type="button"],
.ajs-front-wrap a {
    font-family: 'Rubik', Arial, sans-serif !important;
}

/* Botão escuro */
.ajs-front-wrap button.ajs-front-btn-dark,
.ajs-front-wrap input[type="submit"].ajs-front-btn-dark,
.ajs-front-wrap input[type="button"].ajs-front-btn-dark,
.ajs-front-wrap a.ajs-front-btn-dark {
    appearance: none !important;
    -webkit-appearance: none !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 42px !important;
    padding: 11px 16px !important;
    background: #0f172a !important;
    color: #ffffff !important;
    border: 1px solid #0f172a !important;
    border-radius: 10px !important;
    box-shadow: none !important;
    text-decoration: none !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    line-height: 1.2 !important;
    cursor: pointer !important;
    white-space: nowrap !important;
}

.ajs-front-wrap button.ajs-front-btn-dark:hover,
.ajs-front-wrap input[type="submit"].ajs-front-btn-dark:hover,
.ajs-front-wrap input[type="button"].ajs-front-btn-dark:hover,
.ajs-front-wrap a.ajs-front-btn-dark:hover {
    background: #1e293b !important;
    color: #ffffff !important;
    border-color: #1e293b !important;
}

/* Botão amarelo principal */
.ajs-front-wrap button.ajs-front-btn-primary,
.ajs-front-wrap input[type="submit"].ajs-front-btn-primary,
.ajs-front-wrap input[type="button"].ajs-front-btn-primary,
.ajs-front-wrap a.ajs-front-btn-primary {
    appearance: none !important;
    -webkit-appearance: none !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 42px !important;
    padding: 11px 16px !important;
    background: #facc15 !important;
    color: #0f172a !important;
    border: 1px solid #facc15 !important;
    border-radius: 10px !important;
    box-shadow: none !important;
    text-decoration: none !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    line-height: 1.2 !important;
    cursor: pointer !important;
    white-space: nowrap !important;
}

.ajs-front-wrap button.ajs-front-btn-primary:hover,
.ajs-front-wrap input[type="submit"].ajs-front-btn-primary:hover,
.ajs-front-wrap input[type="button"].ajs-front-btn-primary:hover,
.ajs-front-wrap a.ajs-front-btn-primary:hover {
    background: #eab308 !important;
    color: #0f172a !important;
    border-color: #eab308 !important;
}

/* Botão claro */
.ajs-front-wrap button.ajs-front-btn-light,
.ajs-front-wrap input[type="submit"].ajs-front-btn-light,
.ajs-front-wrap input[type="button"].ajs-front-btn-light,
.ajs-front-wrap a.ajs-front-btn-light {
    appearance: none !important;
    -webkit-appearance: none !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 42px !important;
    padding: 10px 14px !important;
    background: #ffffff !important;
    color: #0f172a !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 10px !important;
    box-shadow: none !important;
    text-decoration: none !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    line-height: 1.2 !important;
    cursor: pointer !important;
    white-space: nowrap !important;
}

.ajs-front-wrap button.ajs-front-btn-light:hover,
.ajs-front-wrap input[type="submit"].ajs-front-btn-light:hover,
.ajs-front-wrap input[type="button"].ajs-front-btn-light:hover,
.ajs-front-wrap a.ajs-front-btn-light:hover {
    background: #f8fafc !important;
    color: #0f172a !important;
    border-color: #cbd5e1 !important;
}

/* Menu desktop/mobile */
.ajs-front-sidebar-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.ajs-front-menu-check {
    display: none !important;
}

.ajs-front-menu-toggle {
    display: none;
}

.ajs-front-menu-area {
    display: flex;
    flex-direction: column;
    gap: 28px;
    flex: 1;
}

/* Mobile/tablet: transforma sidebar em topo com dropdown */
@media (max-width: 1100px) {
    .ajs-front-sidebar {
        min-height: auto !important;
        padding: 14px 18px !important;
        gap: 0 !important;
        position: relative;
        z-index: 20;
    }

    body.admin-bar .ajs-front-sidebar {
        padding-top: 58px !important;
    }

    .ajs-front-sidebar-top {
        width: 100%;
    }

    .ajs-front-brand {
        min-width: 0;
    }

    .ajs-front-brand > div:last-child {
        min-width: 0;
    }

    .ajs-front-brand strong {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 190px;
    }

    .ajs-front-brand span {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 190px;
    }

    .ajs-front-logo {
        width: 42px;
        height: 42px;
        flex: 0 0 42px;
    }

    .ajs-front-menu-toggle {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        gap: 9px;
        min-height: 40px;
        padding: 9px 13px;
        background: #facc15;
        color: #0f172a;
        border-radius: 10px;
        font-size: 14px;
        font-weight: 600;
        line-height: 1;
        cursor: pointer;
        user-select: none;
        white-space: nowrap;
    }

    .ajs-front-menu-toggle i {
        display: block;
        width: 16px;
        height: 12px;
        position: relative;
        border-top: 2px solid currentColor;
        border-bottom: 2px solid currentColor;
    }

    .ajs-front-menu-toggle i::before {
        content: "";
        position: absolute;
        left: 0;
        top: 3px;
        width: 16px;
        height: 2px;
        background: currentColor;
        border-radius: 999px;
    }

    .ajs-front-menu-area {
        display: none;
        width: 100%;
        margin-top: 14px;
        padding-top: 14px;
        border-top: 1px solid rgba(255, 255, 255, 0.14);
        gap: 14px;
    }

    .ajs-front-menu-check:checked ~ .ajs-front-menu-area {
        display: flex;
    }

    .ajs-front-nav {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 8px !important;
    }

    .ajs-front-nav a {
        padding: 12px 13px;
        background: rgba(255, 255, 255, 0.06);
    }

    .ajs-front-nav a.active {
        background: rgba(255, 255, 255, 0.14);
    }

    .ajs-front-user {
        margin-top: 0 !important;
        padding-top: 14px;
    }
}

@media (max-width: 700px) {
    .ajs-front-sidebar {
        padding-left: 14px !important;
        padding-right: 14px !important;
    }

    .ajs-front-brand strong {
        max-width: 150px;
    }

    .ajs-front-brand span {
        max-width: 150px;
    }

    .ajs-front-menu-toggle span {
        display: none;
    }

    .ajs-front-menu-toggle {
        width: 42px;
        height: 42px;
        padding: 0;
    }

    .ajs-front-nav {
        grid-template-columns: 1fr !important;
    }
}

/* Botão de ação padrão em tabelas */
.ajs-front-table a.ajs-front-action-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 34px !important;
    padding: 8px 12px !important;
    border-radius: 9px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    line-height: 1.1 !important;
    text-decoration: none !important;
    white-space: nowrap !important;
    border: 1px solid #cbd5e1 !important;
    background: #ffffff !important;
    color: #0f172a !important;
    box-shadow: none !important;
    transition: 0.15s ease-in-out !important;
}

.ajs-front-table a.ajs-front-action-btn:hover {
    background: #f8fafc !important;
    border-color: #94a3b8 !important;
    color: #0f172a !important;
}

/* Variação para abrir OS */
.ajs-front-table a.ajs-front-action-btn-open {
    background: #0f172a !important;
    color: #ffffff !important;
    border-color: #0f172a !important;
}

.ajs-front-table a.ajs-front-action-btn-open:hover {
    background: #1e293b !important;
    color: #ffffff !important;
    border-color: #1e293b !important;
}

/* Ícones do menu lateral */
.ajs-front-nav a {
    display: flex !important;
    align-items: center !important;
    gap: 11px !important;
}

.ajs-front-nav a img {
    display: block !important;
    width: 19px !important;
    height: 19px !important;
    min-width: 19px !important;
    object-fit: contain !important;
    opacity: 0.88 !important;
    transition: opacity 0.2s ease, transform 0.2s ease !important;
}

.ajs-front-nav a span {
    display: inline-block !important;
    line-height: 1.2 !important;
}

.ajs-front-nav a:hover img,
.ajs-front-nav a.active img {
    opacity: 1 !important;
    transform: translateX(1px) !important;
}

/* Ajuste mobile dos ícones */
@media (max-width: 900px) {
    .ajs-front-nav a img {
        width: 18px !important;
        height: 18px !important;
        min-width: 18px !important;
    }
}

/* Ícone de plus nos botões principais */
.ajs-front-wrap .ajs-btn-plus {
    gap: 9px !important;
}

.ajs-front-wrap .ajs-btn-plus::before {
    content: "+";
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 18px !important;
    height: 18px !important;
    min-width: 18px !important;
    border-radius: 999px !important;
    background: rgba(15, 23, 42, 0.14) !important;
    color: currentColor !important;
    font-size: 16px !important;
    font-weight: 900 !important;
    line-height: 1 !important;
    transform: translateY(-1px);
}

/* Quando o botão for escuro, o plus fica branco suave */
.ajs-front-wrap .ajs-front-btn-dark.ajs-btn-plus::before {
    background: rgba(255, 255, 255, 0.16) !important;
    color: #ffffff !important;
}

/* Quando o botão for amarelo/principal, mantém contraste elegante */
.ajs-front-wrap .ajs-front-btn-primary.ajs-btn-plus::before {
    background: rgba(15, 23, 42, 0.12) !important;
    color: #0f172a !important;
}

/* Ações da tabela */
.ajs-front-table-actions {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    flex-wrap: wrap !important;
}

/* Botão excluir em tabelas */
.ajs-front-table a.ajs-front-action-btn-delete {
    background: #dc2626 !important;
    color: #ffffff !important;
    border-color: #dc2626 !important;
}

.ajs-front-table a.ajs-front-action-btn-delete:hover {
    background: #b91c1c !important;
    color: #ffffff !important;
    border-color: #b91c1c !important;
}

/* Botão vermelho geral */
.ajs-front-wrap a.ajs-front-btn-danger,
.ajs-front-wrap button.ajs-front-btn-danger {
    appearance: none !important;
    -webkit-appearance: none !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 42px !important;
    padding: 11px 16px !important;
    background: #dc2626 !important;
    color: #ffffff !important;
    border: 1px solid #dc2626 !important;
    border-radius: 10px !important;
    box-shadow: none !important;
    text-decoration: none !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    font-size: 14px !important;
    font-weight: 800 !important;
    line-height: 1.2 !important;
    cursor: pointer !important;
    white-space: nowrap !important;
}

.ajs-front-wrap a.ajs-front-btn-danger:hover,
.ajs-front-wrap button.ajs-front-btn-danger:hover {
    background: #b91c1c !important;
    color: #ffffff !important;
    border-color: #b91c1c !important;
}

/* Botão WhatsApp compacto na tabela de Ordens */
.ajs-front-table a.ajs-front-action-btn-whatsapp {
    background: #16a34a !important;
    color: #ffffff !important;
    border-color: #16a34a !important;
}

.ajs-front-table a.ajs-front-action-btn-whatsapp:hover {
    background: #15803d !important;
    color: #ffffff !important;
    border-color: #15803d !important;
}
