@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;700&display=swap');

:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --bg-dark: #0f172a;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --accent: #10b981;
    --error: #ef4444;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

body {
    background-color: var(--bg-dark);
    background-image: 
        radial-gradient(at 0% 0%, hsla(253,16%,7%,1) 0, transparent 50%), 
        radial-gradient(at 50% 0%, hsla(225,39%,30%,1) 0, transparent 50%), 
        radial-gradient(at 100% 0%, hsla(339,49%,30%,1) 0, transparent 50%);
    min-height: 100vh;
    color: var(--text-main);
    display: flex;
    flex-direction: column;
}

/* Glassmorphism Classes */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

/* Auth Pages */
.auth-container {
    max-width: 400px;
    width: 90%;
    margin: auto;
    padding: 2.5rem;
}

.logo {
    font-size: 2rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 2rem;
    background: linear-gradient(to right, #818cf8, #c084fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.form-group {
    margin-bottom: 1rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

input, select {
    width: 100%;
    padding: 0.8rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: white;
    outline: none;
    transition: all 0.3s;
}

option {
    background-color: #1e293b; /* Cor sólida para garantir legibilidade */
    color: white;
}

input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.btn {
    width: 100%;
    padding: 0.9rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
}

.btn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

/* Dashboard Layout */
header {
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--glass-border);
    flex-wrap: wrap;
    gap: 1rem;
}

.container {
    padding: 1.5rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.card {
    padding: 1.5rem;
    margin-bottom: 1.2rem;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

/* Tables */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

th {
    text-align: left;
    padding: 0.6rem 0.4rem;
    color: var(--text-muted);
    font-weight: 400;
    border-bottom: 1px solid var(--glass-border);
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
    white-space: nowrap;
}

th:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

th::after {
    content: ' ↕';
    font-size: 0.7rem;
    opacity: 0.3;
    margin-left: 4px;
}

td {
    padding: 0.6rem 0.4rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
}

/* Tamanho de fonte reduzido para todas as tabelas do dashboard */
#table-entries-rh th, #table-entries-rh td,
#table-entries th, #table-entries td,
#table-freelancers th, #table-freelancers td,
#table-freelancers-rh th, #table-freelancers-rh td,
#table-users th, #table-users td,
#table-shops th, #table-shops td,
#table-logs th, #table-logs td {
    font-size: 0.75rem;
    font-weight: 300;
    text-align: center;
}

tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

/* Scrollable Table Container */
.table-container-scroll {
    max-height: 500px;
    overflow-y: auto;
    padding-right: 4px;
}

.table-container-scroll table thead th {
    position: sticky;
    top: -1px;
    z-index: 10;
    background: #1a2335; /* Cor sólida harmonizada com o tema escuro */
    box-shadow: 0 1px 0 var(--glass-border);
}

/* Custom Scrollbar for harmonious feel */
.table-container-scroll::-webkit-scrollbar {
    width: 6px;
}

.table-container-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.table-container-scroll::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 20px;
}

.table-container-scroll::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Badges */
.badge {
    padding: 0.3rem 0.7rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-align: right;
    line-height: 1.2;
    white-space: nowrap;
}

.badge-rh { background: rgba(16, 185, 129, 0.2); color: #10b981; }
.badge-admin { background: rgba(239, 68, 68, 0.2); color: #ef4444; }
.badge-accent { background: rgba(245, 158, 11, 0.2); color: #f59e0b; }
.badge-info { background: rgba(59, 130, 246, 0.2); color: #3b82f6; }
.badge-sent { background: rgba(139, 92, 246, 0.2); color: #8b5cf6; }
.badge-gerente { background: rgba(99, 102, 241, 0.2); color: #818cf8; }

/* Status Tabs */
.status-tabs-container {
    display: flex;
    width: 100%;
    margin: 1rem 0;
    overflow: hidden;
    border-radius: 12px;
    background: var(--glass-bg);
}

.status-tab {
    flex: 1;
    padding: 1rem 0.5rem;
    background: transparent;
    border: none;
    border-radius: 0;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    clip-path: polygon(0% 0%, calc(100% - 15px) 0%, 100% 50%, calc(100% - 15px) 100%, 0% 100%, 15px 50%);
    margin-right: -15px; 
    min-width: fit-content;
    padding-left: 20px;
    padding-right: 20px;
}

.status-tab:first-child {
    clip-path: polygon(0% 0%, calc(100% - 15px) 0%, 100% 50%, calc(100% - 15px) 100%, 0% 100%);
}

.status-tab:last-child {
    clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%, 15px 50%);
    margin-right: 0;
}

.status-tab:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

/* Specific Active Colors */
.status-tab.active {
    color: white;
    box-shadow: none; /* Shadow doesn't look well with clip-path */
}

/* Validação - Orange */
.status-tab[data-status="aguardando_validacao"].active {
    background: #f59e0b;
}

/* Pagto Liberado - Blue */
.status-tab[data-status="pagamento_liberado"].active {
    background: #3b82f6;
}

/* Pagto Enviado - Purple */
.status-tab[data-status="pagamento_enviado"].active {
    background: #8b5cf6;
}

/* Pago - Green */
.status-tab[data-status="pago"].active {
    background: #10b981;
}

/* Todos - Primary */
.status-tab[data-status=""].active {
    background: var(--primary);
}

.status-tab .count {
    background: #f59e0b;
    color: white;
    padding: 2px 6px;
    border-radius: 50%;
    font-size: 0.65rem;
    font-weight: 800;
    margin-left: 0.5rem;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
}

.status-tab.active .count {
    background: white;
    color: #000;
}

/* Nav Tabs (Top Dashboard) */
.nav-tabs-container {
    display: flex;
    gap: 0.8rem;
    margin-bottom: 1.2rem;
    padding-bottom: 0.5rem;
    overflow-x: auto;
}

.nav-tab {
    flex: 1; /* Faz todas terem o mesmo tamanho e preencherem o espaço */
    padding: 0.8rem 1rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.nav-tab:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.nav-tab.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-content {
    width: 90%;
    max-width: 500px;
    padding: 2rem;
}

/* Responsive */
@media (max-width: 1024px) {
    .status-tabs-container {
        flex-wrap: wrap;
        background: transparent;
        overflow: visible;
        gap: 0.5rem;
    }
    .status-tab {
        flex: 1 1 calc(33.33% - 0.5rem);
        min-width: 150px;
        clip-path: none !important;
        margin-right: 0 !important;
        border-radius: 8px !important;
        background: var(--glass-bg);
        border: 1px solid var(--glass-border);
        padding: 0.8rem 0.5rem;
    }
    .status-tab:last-child {
        margin-right: 0;
    }
}

@media (max-width: 768px) {
    .container { padding: 1rem; }
    
    header { 
        padding: 1rem; 
        flex-direction: column; 
        align-items: center;
        text-align: center;
        gap: 0.8rem;
    }

    header .logo {
        margin-bottom: 0;
        font-size: 1.5rem;
    }

    header div[style*="display: flex"] {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }

    .nav-tabs-container {
        padding-bottom: 0.8rem;
        margin-bottom: 1rem;
    }

    .nav-tab {
        flex: none;
        padding: 0.6rem 1rem;
        font-size: 0.8rem;
    }

    .auth-container { padding: 1.5rem; }
    
    .card { padding: 1rem !important; }

    .status-tab {
        flex: 1 1 calc(50% - 0.5rem);
        font-size: 0.75rem;
    }

    .flex-between {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .flex-between h2, .flex-between h3 {
        font-size: 1.2rem;
    }

    .flex-between button {
        width: 100% !important;
    }

    .filters-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }
}

@media (max-width: 480px) {
    .status-tab {
        flex: 1 1 100%;
    }
    
    header div[style*="display: flex"] {
        flex-direction: column;
        width: 100%;
    }
    
    header .glass {
        width: 100%;
    }
}

/* UI Feedback */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    color: white;
    z-index: 2000;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Estilos de Impressão do Recibo */
#receipt-area {
    display: none;
}

@media print {
    body * {
        visibility: hidden !important;
    }
    #receipt-area, #receipt-area * {
        visibility: visible !important;
    }
    #receipt-area {
        display: block !important;
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        color: black !important;
        background: white !important;
        padding: 40px;
        font-family: Arial, sans-serif;
    }
    .receipt-header {
        text-align: center;
        font-weight: bold;
        font-size: 1.5rem;
        margin-bottom: 2rem;
        text-transform: uppercase;
    }
    .receipt-loja-box {
        text-align: center;
        margin-bottom: 2rem;
    }
    .receipt-loja {
        background: #ffff00 !important;
        -webkit-print-color-adjust: exact;
        padding: 5px 20px;
        font-weight: bold;
        display: inline-block;
        border: 1px solid black;
    }
    .receipt-content {
        line-height: 1.8;
        font-size: 1.1rem;
        text-align: justify;
    }
    .highlight {
        background: #ffff00 !important;
        -webkit-print-color-adjust: exact;
        padding: 0 4px;
        font-weight: bold;
    }
    .receipt-footer {
        margin-top: 4rem;
    }
    .signature-area {
        margin-top: 6rem;
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    .signature-line {
        border-top: 1px solid black;
        width: 450px;
        text-align: center;
        padding-top: 5px;
        font-weight: bold;
        text-transform: uppercase;
    }
}


/* --- Process Flow Styles --- */
.process-wrapper {
    padding: 1rem;
    overflow-x: auto;
}

.process-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    padding-bottom: 2rem;
}

.process-step {
    flex: 1;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.step-card {
    width: 100%;
    height: 100%;
    min-height: 320px; /* Padroniza o tamanho vertical */
    padding: 1.2rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    transition: all 0.3s ease;
    cursor: default;
    z-index: 2;
    display: flex;
    flex-direction: column;
}

.process-step:hover .step-card {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-5px);
    border-color: var(--primary);
}

.step-header {
    margin-bottom: 0.8rem;
}

.step-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: white; /* Deixando branco para destacar */
}

.step-role {
    font-size: 0.75rem;
    color: #818cf8; /* Um tom de azul/roxo um pouco mais claro e vibrante */
    margin-bottom: 0.5rem;
    display: block;
    font-weight: 600;
}

.step-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.step-body {
    flex: 1; /* Faz o corpo ocupar o espaço restante, empurrando o footer */
    display: flex;
    flex-direction: column;
}

.step-shape {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 1rem;
    width: 100%;
}

/* Cores das Formas */
.shape-grey { background: #475569; color: white; }
.shape-yellow { background: #f59e0b; color: white; }
.shape-blue { background: #3b82f6; color: white; }
.shape-purple { background: #8b5cf6; color: white; }
.shape-green { background: #10b981; color: white; }

.step-desc {
    font-size: 0.8rem;
    line-height: 1.4;
    color: var(--text-muted);
    min-height: 3.5rem;
}

.step-footer {
    margin-top: auto; /* Empurra para o fundo do card */
    padding-top: 1rem;
    border-top: 1px solid var(--glass-border);
}

.step-btn-info {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-main);
    background: rgba(255,255,255,0.1);
    padding: 4px 8px;
    border-radius: 4px;
}

.step-flow-tag {
    margin-top: auto; /* Garante que fique no rodapé do card */
    padding-top: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    font-style: italic;
    color: var(--primary);
    position: relative;
}

/* Conectores removidos conforme solicitado */

/* Responsividade Mobile */
@media (max-width: 1024px) {
    .process-wrapper {
        overflow-x: hidden;
    }
    .process-container {
        grid-template-columns: 1fr;
        min-width: 100%;
        align-items: stretch;
    }
    .process-step {
        flex-direction: row;
        gap: 1rem;
        text-align: left;
        align-items: flex-start;
    }
    /* Conectores mobile removidos */
    .step-card {
        text-align: left;
    }
    .step-label { text-align: left; }
}

/* --- Loading Spinner & States --- */
.spinner {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
    display: inline-block;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.btn-loading {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;
    pointer-events: none !important;
    opacity: 0.8 !important;
}
