/* =`============================================
    1. ROOT VARIABLES & GLOBAL RESETS
    ============================================= */

:root {
    /* [ALTERADO] Variáveis do tema escuro (login.css) agora são o padrão. */
    --primary-color: #8a2be2;
    --accent-color: #00c6ff;
    --primary-gradient: linear-gradient(to right, var(--primary-color), var(--accent-color));
    --special-gradient: linear-gradient(135deg, rgba(138, 43, 226, 0.9) 0%, rgba(0, 198, 255, 0.9) 100%);

    --text-light: #e2e8f0;
    --text-dark-original: #161c2d; /* Mantido para referência */
    --text-dark: #e2e8f0; /* [ALTERADO] Cor de texto padrão para tema escuro */
    --text-muted: #94a3b8;

    --background-color: #0f172a;
    --surface-color: rgba(30, 41, 59, 0.5);
    --border-color: rgba(148, 163, 184, 0.2);

    --font-family-sans-serif: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --border-radius: 0.75rem; /* Padronizado com login.css */
    --box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family-sans-serif);
    line-height: 1.6;
    /* [ALTERADO] Fundo escuro com gradiente sutil */
    background-color: var(--background-color);
    background-image: linear-gradient(to bottom right, #020617, #1e1b4b, #020617);
    color: var(--text-dark);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--accent-color); /* [ALTERADO] */
    text-decoration: none;
    transition: color 0.2s ease-in-out;
}

a:hover {
    color: var(--text-light); /* [ALTERADO] */
}

img {
    max-width: 100%;
    height: auto;
}

/* =============================================
    2. LAYOUT & CONTAINER
    ============================================= */

.container {
    width: 100%;
    padding-right: 15px;
    padding-left: 15px;
    margin-right: auto;
    margin-left: auto;
}

.container-fluid {
    width: 100%;
    padding-right: 15px;
    padding-left: 15px;
    margin-right: auto;
    margin-left: auto;
}

/* =============================================
    3. NAVIGATION BAR (Mobile First)
    ============================================= */

.navbar {
    background-image: var(--primary-gradient);
    padding: 0.5rem 1rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.navbar .container-fluid {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.navbar-header {
    display: flex;
    align-items: center;
}

.navbar-brand img {
    max-height: 45px;
}

.navbar-toggle {
    display: block;
    background: transparent;
    border: 1px solid var(--text-light);
    border-radius: 4px;
    padding: 0.25rem 0.75rem;
    cursor: pointer;
}

.navbar-toggle .icon-bar {
    display: block;
    width: 22px;
    height: 2px;
    background-color: var(--text-light);
    border-radius: 1px;
}

.navbar-toggle .icon-bar + .icon-bar {
    margin-top: 4px;
}

.navbar-collapse {
    display: none;
    width: 100%;
    flex-basis: 100%;
    flex-grow: 1;
}

.navbar-collapse.show {
    display: block;
}

.nav-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0;
    padding-top: 1rem;
}

.nav-links li a {
    color: var(--text-light);
    padding: 0.75rem 0;
    border-radius: 0;
    transition: background-color 0.2s ease;
}

.nav-links li a:hover,
.nav-links li.active a {
    background-color: rgba(255, 255, 255, 0.1); /* [ALTERADO] */
    text-decoration: none; /* [ALTERADO] */
}

/* =============================================
    4. MAIN CONTENT & CONTROLS
    ============================================= */

main.container {
    padding-top: 2rem;
    padding-bottom: 2rem;
}

.controls-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.filters-container {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.btn {
    display: inline-block;
    font-weight: 600; /* [ALTERADO] */
    text-align: center;
    vertical-align: middle;
    cursor: pointer;
    user-select: none;
    background-color: transparent;
    border: 1px solid transparent;
    padding: 0.5rem 1rem;
    font-size: 1rem;
    border-radius: var(--border-radius);
    transition: all 0.2s ease-in-out;
}

.btn-primary {
    color: var(--text-light);
    background-image: var(--primary-gradient); /* [ALTERADO] */
    border-color: transparent;
}

.btn-primary:hover {
    opacity: 1; /* Será controlado pelo refinamento premium */
}

.btn-special {
    color: var(--text-light);
    background-image: var(--special-gradient);
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

.btn-block {
    display: block;
    width: 100%;
}

.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1000;
    display: none;
    min-width: 10rem;
    padding: 0.5rem 0;
    margin-top: 0.25rem;
    font-size: 1rem;
    color: var(--text-light); /* [ALTERADO] */
    text-align: left;
    list-style: none;
    background-color: #1e293b; /* [ALTERADO] */
    background-clip: padding-box;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    max-height: 300px;
    overflow-y: auto;
}

.dropdown-menu.show {
    display: block;
}

.dropdown-menu a {
    display: block;
    width: 100%;
    padding: 0.5rem 1.5rem;
    clear: both;
    font-weight: 400;
    color: var(--text-light); /* [ALTERADO] */
    text-align: inherit;
    white-space: nowrap;
    background-color: transparent;
    border: 0;
}

.dropdown-menu a:hover {
    background-color: rgba(45, 55, 72, 0.8); /* [ALTERADO] */
}

.search-container {
    display: flex;
}

.form-control {
    display: block;
    width: 100%;
    padding: 0.5rem 1rem;
    font-size: 1rem;
    line-height: 1.5;
    /* [ALTERADO] */
    color: var(--text-light);
    background-color: #334155;
    background-clip: padding-box;
    border: 1px solid #475569;
    border-radius: var(--border-radius);
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.form-control:focus {
    outline: 0;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(138, 43, 226, 0.3);
}

.search-container .btn {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    border: 1px solid #475569;
    border-left: 0;
    background: #334155; /* [NOVO] */
    color: var(--text-muted); /* [NOVO] */
}
.search-container .btn:hover {
    background: #475569; /* [NOVO] */
    color: var(--text-light); /* [NOVO] */
}

/* =============================================
    5. SERVICES TABLE (Mobile First - FINAL LAYOUT)
    ============================================ */

.table-container {
    overflow-x: auto;
    /* [ALTERADO] */
    background: var(--surface-color);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 1rem;
    border: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
}

.services-table {
    width: 100%;
    margin-bottom: 1rem;
    color: var(--text-light); /* [ALTERADO] */
    border-collapse: separate;
    border-spacing: 0 0.5rem;
}

.services-table thead {
    display: none;
}

.services-table,
.services-table tbody {
    display: block;
}

.services-table tr {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background-color: rgba(45, 55, 72, 0.5); /* [ALTERADO] */
}

.services-table td {
    display: block;
    border: none;
    padding: 0;
    background-color: transparent;
}

.services-table td[data-label="ID"],
.services-table td[data-label="Mínimo"],
.services-table td[data-label="Máximo"] {
    display: none;
}

.services-table td[data-label="Serviço"] {
    text-align: left;
    font-weight: 500;
}

.services-table td[data-label="Preço / Mil"] {
    text-align: right;
    font-weight: bold;
    color: var(--accent-color); /* [ALTERADO] */
    white-space: nowrap;
}

.services-table td[data-label="Detalhes"] {
    text-align: right;
}

.services-table td:before {
    display: none;
}

.category-header {
    display: block;
    background-image: var(--special-gradient);
    color: var(--text-light);
    font-weight: bold;
    padding: 0.75rem;
    border-radius: var(--border-radius);
    margin-top: 1rem;
    margin-bottom: 0;
}
.category-header:first-child {
    margin-top: 0;
}
.category-header td {
    padding: 0;
}


/* =============================================
    6. MODAL
    ============================================= */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1050;
    display: none;
    width: 100%;
    height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    outline: 0;
    background-color: rgba(0, 0, 0, 0.7); /* [ALTERADO] */
    backdrop-filter: blur(5px); /* [NOVO] */
}

.modal.show {
    display: block;
}

.modal-dialog {
    position: relative;
    width: auto;
    margin: 1rem;
    pointer-events: none;
}

.modal-content {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    pointer-events: auto;
    /* [ALTERADO] */
    background-color: #1e293b;
    background-clip: padding-box;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    outline: 0;
}

.modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-title {
    margin-bottom: 0;
    line-height: 1.5;
    color: var(--text-light); /* [ALTERADO] */
}

.modal-header .close {
    padding: 1rem;
    margin: -1rem -1rem -1rem auto;
    background-color: transparent;
    border: 0;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
    color: #fff; /* [ALTERADO] */
    text-shadow: none; /* [ALTERADO] */
    opacity: .75;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.modal-header .close:hover {
    opacity: 1;
}

.modal-body {
    position: relative;
    flex: 1 1 auto;
    padding: 1rem;
}

.video-container {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.modal-header.bg-primary {
    background-image: var(--primary-gradient); /* [ALTERADO] */
    color: var(--text-light);
    border-bottom: 0;
}

.text-white {
    color: var(--text-light) !important;
}

.modal-header .close.text-white {
    color: var(--text-light);
    text-shadow: none;
    opacity: 0.75;
}
.modal-header .close.text-white:hover {
    opacity: 1;
}

.badge {
    display: inline-block;
    padding: .25em .6em;
    font-size: 75%;
    font-weight: 700;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: .25rem;
    /* [ALTERADO] */
    background-color: rgba(138, 43, 226, 0.2);
    color: var(--accent-color);
    margin-bottom: 1rem;
}

.modal-body h4 {
    margin-bottom: 1rem;
    color: var(--text-light); /* [ALTERADO] */
}

#details-modal-description {
    margin-bottom: 1.5rem;
    color: var(--text-muted); /* [ALTERADO] */
}

.services-info {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.si-grid {
    display: flex;
    justify-content: space-around;
    text-align: center;
    margin-bottom: 1.5rem;
    gap: 1rem;
}

.si-item {
    flex: 1;
}

.si-circle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: rgba(138, 43, 226, 0.1); /* [ALTERADO] */
    color: var(--accent-color); /* [ALTERADO] */
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.5rem auto;
    font-size: 1.5rem;
}

.si-item small {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.si-item p {
    font-weight: bold;
    margin: 0;
    color: var(--text-light); /* [ALTERADO] */
}

/* =============================================
    7. MISCELLANEOUS COMPONENTS
    ============================================= */

.info-well {
    padding: 1rem;
    margin-top: 2rem;
    background-color: rgba(45, 55, 72, 0.5); /* [ALTERADO] */
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-muted); /* [NOVO] */
}
.info-well strong {
    color: var(--text-light); /* [NOVO] */
}

.whatsapp-button {
    position: fixed;
    width: 60px;
    height: 60px;
    bottom: 25px;
    right: 25px;
    background-color: #25d366;
    color: var(--text-light);
    border-radius: 50px;
    text-align: center;
    font-size: 30px;
    box-shadow: 2px 2px 3px #999;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.whatsapp-button:hover {
    transform: scale(1.1);
    color: var(--text-light);
}

.footer {
    text-align: center;
    padding: 2rem;
    margin-top: 2rem;
    background: #020617; /* [ALTERADO] */
    color: var(--text-muted);
    border-top: 1px solid var(--border-color); /* [NOVO] */
}

/* =============================================
    8. RESPONSIVE DESIGN (Desktop Enhancements)
    ============================================= */

@media (min-width: 576px) {
    .container { max-width: 540px; }
    .modal-dialog { max-width: 500px; margin: 1.75rem auto; }
}

@media (min-width: 769px) {
    .navbar .container-fluid {
        flex-wrap: nowrap;
    }
    .navbar-toggle {
        display: none;
    }
    .navbar-collapse {
        display: flex;
        width: auto;
        flex-basis: auto;
    }
    .nav-links {
        flex-direction: row;
        gap: 1rem;
        padding-top: 0;
    }
    .nav-links li a {
        padding: 0.5rem 1rem;
        border-radius: var(--border-radius);
    }
    .nav-links li a:hover,
    .nav-links li.active a {
        background-color: rgba(255, 255, 255, 0.15);
        text-decoration: none;
    }

    .services-table {
        display: table;
        border-collapse: collapse;
        border-spacing: 0;
    }
    .services-table thead {
        display: table-header-group;
    }
    .services-table tbody {
        display: table-row-group;
    }
    .services-table tr {
        display: table-row;
        padding: 0;
        border: 0;
        background-color: transparent; /* [NOVO] */
    }
    .services-table tr:hover {
        background-color: rgba(45, 55, 72, 0.5); /* [NOVO] */
    }

    .services-table td, .services-table th {
        display: table-cell;
        padding: 0.75rem;
        text-align: left;
        border-top: 1px solid var(--border-color);
        vertical-align: middle;
    }

    .services-table td[data-label="ID"],
    .services-table td[data-label="Mínimo"],
    .services-table td[data-label="Máximo"] {
        display: table-cell;
    }

    .services-table thead th {
        border-bottom: 2px solid var(--border-color);
        white-space: nowrap;
    }
    .services-table .col-details {
        text-align: center;
    }
    .category-header {
        display: table-row;
    }
    .category-header td {
        display: table-cell;
        padding: 0.75rem;
        text-align: left;
    }
}

@media (min-width: 992px) {
    .container { max-width: 960px; }
}

@media (min-width: 1200px) {
    .container { max-width: 1140px; }
}

/* =============================================
    REFINAMENTOS DE ESTILO PREMIUM (DROP-IN)
    ============================================= */

:root {
    --ease-smooth: cubic-bezier(.22, .61, .36, 1);
    --ease-emph: cubic-bezier(.2, .8, .2, 1);
    --dur-fast: 150ms;
    --dur-base: 220ms;
    --dur-slow: 320ms;
    
    --elev-1: 0 6px 18px rgba(0,0,0,.2); /* [ALTERADO] */
    --elev-2: 0 10px 28px rgba(0,0,0,.3); /* [ALTERADO] */
    --elev-inset: inset 0 1px 0 rgba(255,255,255,.1); /* [ALTERADO] */

    --hairline: 1px solid rgba(255,255,255,.08);
}

a, button, .btn, .dash_small_card, .affiliate-card, .order-card, .payment-card, .stat-item {
    transition: transform var(--dur-base) var(--ease-smooth),
                box-shadow var(--dur-base) var(--ease-smooth),
                background-color var(--dur-fast) var(--ease-smooth),
                color var(--dur-fast) var(--ease-smooth),
                border-color var(--dur-fast) var(--ease-smooth),
                opacity var(--dur-fast) var(--ease-smooth);
}

@keyframes sheen { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }

.dash_add_btn, .btn-submit-order, .btn-primary {
    background-size: 200% 100%;
    box-shadow: var(--elev-1);
    position: relative;
    will-change: transform;
}
.dash_add_btn:hover, .btn-submit-order:hover, .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--elev-2);
    background-image: linear-gradient(135deg,rgba(255,255,255,.18) 0%,rgba(255,255,255,0) 35%),var(--primary-gradient);
    animation: sheen 1.4s var(--ease-smooth);
    opacity: 1;
}
.dash_add_btn:focus-visible, .btn-submit-order:focus-visible, .btn-primary:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(138,43,226,.28),var(--elev-2); /* [ALTERADO] */
}

.dash_main_card, .order-card, .affiliate-card, .payment-card, .table-wrapper, .controls-card {
    box-shadow: var(--box-shadow); /* [ALTERADO] */
    border: 1px solid var(--border-color);
    transform: translateZ(0);
}
.dash_main_card:hover, .order-card:hover, .affiliate-card:hover, .payment-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0, 198, 255, 0.2); /* [ALTERADO] */
}
.stat-item p {
    letter-spacing: .2px;
}
.stat-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--elev-1);
}

.modal.show .modal-content {
    animation: modalIn var(--dur-slow) var(--ease-smooth) both;
}
@keyframes modalIn {
    from {
        opacity: 0;
        transform: translateY(8px) scale(.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.toast {
    border: 1px solid rgba(255,255,255,.08);
    backdrop-filter: blur(6px);
    box-shadow: var(--elev-2);
}

.form-control, #amount {
    background-color: #334155; /* [ALTERADO] */
    border: 1px solid #475569; /* [ALTERADO] */
    box-shadow: var(--elev-inset);
}
.form-control:hover, #amount:hover {
    border-color: var(--accent-color); /* [ALTERADO] */
}
.form-control:focus, #amount:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(138,43,226,.28); /* [ALTERADO] */
}

.dash_icon_circle {
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.35), 0 8px 20px rgba(0,0,0,.25); /* [ALTERADO] */
    backdrop-filter: blur(4px);
}
.dash_small_card:hover {
    transform: translateY(-4px) scale(1.01);
}

:root {
  --primary-gradient: linear-gradient(to right, var(--primary-color), var(--accent-color));
}

/* =============================================
    ACABAMENTOS FINAIS (DROP-IN, SEM REMOVER NADA)
    ============================================= */

a:focus-visible,
.btn:focus-visible,
.dropdown-menu a:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(138,43,226,.28); /* [ALTERADO] */
  border-radius: .25rem;
}

.services-table tr:active {
  transform: scale(.998);
  opacity: .96;
}
.services-table td[data-label="Preço / Mil"]{
  background: linear-gradient(90deg, rgba(0, 198, 255, 0.08), transparent 55%); /* [ALTERADO] */
  padding-right: .25rem;
}

@media (prefers-reduced-motion: reduce){
  * { transition: none !important; animation: none !important; }
}

/* =============================================
    [NOVO] ESTILOS PARA COMPONENTES PERSUASIVOS
    ============================================= */
.cta-card {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--primary-color);
    padding: 1.5rem;
    margin-bottom: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    text-align: center;
    backdrop-filter: blur(10px); /* [NOVO] */
}
.cta-card h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-light); /* [ALTERADO] */
}
.cta-card p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}
.cta-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-items: center;
}
.nav-links .btn-cadastro {
    background-color: var(--accent-color); /* [ALTERADO] */
    color: var(--text-dark-original) !important;
    padding: 0.5rem 1rem !important;
    border-radius: var(--border-radius);
    text-decoration: none !important;
    font-weight: 600; /* [ALTERADO] */
}
.nav-links .btn-cadastro:hover {
    background-color: #00b2e3; /* [ALTERADO] */
    color: var(--text-dark-original) !important;
}
#detailsModal .modal-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1rem;
}
#detailsModal .modal-actions .btn {
    width: 100%;
}
@media (min-width: 769px) {
    .cta-actions {
        flex-direction: row;
        justify-content: center;
    }
    #detailsModal .modal-actions {
        flex-direction: row;
    }
    .nav-links {
        align-items: center;
    }
    .nav-links li {
        display: flex;
        align-items: center;
    }
}

#details-modal-description {
    white-space: pre-wrap;
}