/* =========================================================
   UI SAAS GLOBAL - LIMPO E UNIFICADO
   ========================================================= */

:root{
    --saas-bg-card: #1f2937;
    --saas-bg-header: #0f172a;
    --saas-border: rgba(255,255,255,0.07);

    --saas-text: #f3f4f6;
    --saas-text-muted: #9ca3af;

    --saas-primary: #38bdf8;
    --saas-success: #22c55e;
    --saas-warning: #f59e0b;
    --saas-danger: #ef4444;

    --saas-radius-lg: 18px;
}

/* =========================================================
   CARD
   ========================================================= */

.saas-card{
    background:
        radial-gradient(circle at top left, rgba(56,189,248,0.08), transparent 35%),
        linear-gradient(135deg, #1e293b, #243246, #1f2b3d);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: var(--saas-radius-lg);
    box-shadow: 0 20px 45px rgba(0,0,0,0.22);
    padding: 24px;
}

/* =========================================================
   HEADER
   ========================================================= */

.saas-header{
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.saas-header__title{
    display: flex;
    gap: 10px;
    align-items: center;
}

.saas-header__title h2{
    margin: 0;
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--saas-primary);
}

.saas-header__title i{
    color: var(--saas-primary);
    font-size: 1.55rem;
}

.saas-header__subtitle{
    margin: 6px 0 0;
    color: var(--saas-text-muted);
    font-size: 0.95rem;
}

.saas-toolbar{
    display: flex;
    align-items: center;
    gap: 12px;
}

/* =========================================================
   CAMPO DE PESQUISA
   ========================================================= */

.saas-search{
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 320px;
    height: 48px;
    padding: 0 16px;
    border-radius: 14px;
    background: #2b3340;
    border: 1px solid rgba(56,189,248,0.28) !important;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.04),
        0 6px 18px rgba(0,0,0,0.14);
}

.saas-search i{
    color: #9fb3c8;
    font-size: 1rem;
}

.saas-search input{
    width: 100%;
    background: transparent !important;
    border: none !important;
    outline: none !important;
    color: #eef2f7 !important;
    font-size: 0.98rem;
}

.saas-search input::placeholder{
    color: #9fb3c8;
}

.saas-search:focus-within{
    border: 1px solid rgba(56,189,248,0.28) !important;    
}

/* =========================================================
   BOTÕES E LINKS
   ========================================================= */

.table-link{
    display: inline-block;
    max-width: 100%;
    color: #f8fafc;
    text-decoration: none !important;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color .15s ease;
}

.table-link:hover{
    color: var(--saas-primary) !important;
}

.table-actions{
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-table-action{
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    border: 1px solid rgba(56,189,248,0.18);
    background: rgba(56,189,248,0.08);
    color: #7dd3fc;
    text-decoration: none;
    transition: all .18s ease;
}

.btn-table-action:hover{
    background: rgba(56,189,248,0.16);
    color: #e0f2fe;
}

/* =========================================================
   BADGES
   ========================================================= */

.status-badge{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 70px;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1;
}

.status-badge--ativo{
    background: rgba(34,197,94,0.14);
    color: #86efac;
}

.status-badge--inativo{
    background: rgba(148,163,184,0.14);
    color: #cbd5e1;
}

.status-badge--warning{
    background: rgba(245,158,11,0.14);
    color: #fcd34d;
}

.status-badge--danger{
    background: rgba(239,68,68,0.14);
    color: #fca5a5;
}

/* =========================================================
   TABELA
   ========================================================= */

.saas-table-wrap{
    overflow-x: hidden;
    border-radius: 16px;
}

#tabela-processos,
#tabela-clientes,
.saas-table {
    width: 100% !important;
    min-width: 0 !important;
    table-layout: fixed;
}

#tabela-processos th.th-acoes,
#tabela-processos td:last-child{
    text-align: center !important;
}

/* HEADER */
#tabela-processos thead,
#tabela-processos thead tr{
    background: transparent !important;
}

#tabela-processos thead th{
    background: rgba(32, 32, 35, 0.9)!important;
    color: #fff!important;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    
    font-size: 0.90rem !important;
    font-weight: 700 !important;
    text-transform: uppercase;
    letter-spacing: 0.04em;

    padding: 14px 16px !important; /* ↓ diminui altura */
    line-height: 1;

    border: none !important;
    white-space: nowrap;
    vertical-align: middle !important;
}

#tabela-processos thead th:first-child{
    border-top-left-radius: 14px !important;
}

#tabela-processos thead th:last-child{
    border-top-right-radius: 14px !important;
}


/* BODY */
#tabela-processos tbody tr{
    background: rgba(43,57,80,0.92) !important;
    height: 46px;
    transition: background .15s ease;
}

#tabela-processos tbody tr:nth-child(even){
    background: rgba(49,64,90,0.95) !important;
}

#tabela-processos tbody tr:hover{
    background: rgba(59,76,106,0.98) !important;
}

#tabela-processos tbody tr:first-child{
    background: rgba(39,52,73,0.96) !important;
}

#tabela-processos tbody tr:first-child td{
    border-top: 1px solid rgba(255,255,255,0.03) !important;
}

#tabela-processos tbody td{
    padding: 12px 14px !important;
    font-size: 0.9rem;
    color: #eef2f7 !important;
    border-bottom: 1px solid rgba(255,255,255,0.05) !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle !important;
    background: transparent !important;
}

#tabela-processos tbody td:first-child{
    font-weight: 700;
    color: #fff !important;
}


/* TRUNCAMENTO */
.td-truncate{
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
}

/* ORDENAÇÃO */
#tabela-processos th.sorting:before,
#tabela-processos th.sorting:after,
#tabela-processos th.sorting_asc:before,
#tabela-processos th.sorting_asc:after,
#tabela-processos th.sorting_desc:before,
#tabela-processos th.sorting_desc:after{
    color: #64748b !important;
    opacity: .7;
    font-size: 0.72rem !important;
    right: 8px !important;
}

/* =========================================================
   DATATABLES
   ========================================================= */

.dataTables_wrapper{
    color: var(--saas-text);
}

.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter{
    margin-bottom: 16px;
}

.dataTables_wrapper .dataTables_length label,
.dataTables_wrapper .dataTables_filter label,
.dataTables_wrapper .dataTables_info{
    color: var(--saas-text-muted) !important;
    font-weight: 500;
}

.dataTables_wrapper .dataTables_length select{
    background: #374151 !important;
    color: #fff !important;
    border: 1px solid var(--saas-border) !important;
    border-radius: 10px;
    min-height: 40px;
    padding: 8px 12px;
    outline: none;
}

.dataTables_scrollHead,
.dataTables_scrollHeadInner,
.dataTables_scrollHeadInner table,
.dataTables_scrollBody,
.dataTables_scrollBody table{
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
}

.dataTables_scrollHead{
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

.dataTables_scrollBody{
    margin-top: 0 !important;
    padding-top: 0 !important;
    overflow-y: hidden !important;
}

.dataTables_scrollHeadInner,
.dataTables_scrollHeadInner table{
    width: 100% !important;
}

/* PAGINAÇÃO */
.dataTables_wrapper .dataTables_paginate{
    padding-top: 10px;
}

.dataTables_wrapper .dataTables_paginate .paginate_button{
    background: rgba(255,255,255,0.04) !important;
    color: #aab6c5 !important;
    border: none !important;
    border-radius: 10px;
    min-width: 36px;
    height: 36px;
    line-height: 22px;
    margin: 0 3px;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover{
    background: rgba(56,189,248,0.16) !important;
    color: #fff !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover{
    background: rgba(255,255,255,0.08) !important;
    color: #fff !important;
}

/* =========================================================
   RESPONSIVO
   ========================================================= */

@media (max-width: 991.98px){
    .saas-card{
        padding: 18px;
    }

    .saas-header__title h2{
        font-size: 1.5rem;
    }

    .saas-search{
        min-width: 100%;
    }

    .saas-toolbar{
        width: 100%;
    }
}

