/* ==========================================================================
   Fazendinha — Tema do Painel Admin
   Design moderno, responsivo e mobile-first
   Aplicado a todas as páginas que usam layouts/admin.blade.php
   ========================================================================== */

:root {
    --admin-bg: #f4f6fb;
    --admin-surface: #ffffff;
    --admin-border: #e6eaf2;
    --admin-primary: #4f46e5;
    --admin-primary-dark: #4338ca;
    --admin-violet: #8b5cf6;
    --admin-accent: #06b6d4;
    --admin-sidebar-top: #0f172a;
    --admin-sidebar-bottom: #1e1b4b;
    --admin-sidebar-active: linear-gradient(90deg, #4f46e5, #8b5cf6);
    --admin-text: #1e293b;
    --admin-text-muted: #64748b;
    --admin-success: #10b981;
    --admin-danger: #ef4444;
    --admin-warning: #f59e0b;
    --admin-radius: 14px;
    --admin-shadow: 0 1px 3px rgba(15, 23, 42, .06), 0 8px 24px rgba(15, 23, 42, .06);
    --admin-shadow-lg: 0 12px 32px rgba(15, 23, 42, .16);
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */
body {
    font-family: 'Inter', 'Source Sans Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--admin-bg);
    color: var(--admin-text);
}

h1, h2, h3, h4, h5, h6 {
    color: var(--admin-text);
}

a {
    transition: color .15s ease;
}

/* Barra de rolagem */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #c3cbd9;
    border-radius: 8px;
}
::-webkit-scrollbar-thumb:hover {
    background: #a9b4c7;
}

/* --------------------------------------------------------------------------
   Navbar (topo)
   -------------------------------------------------------------------------- */
.main-header.navbar {
    background: var(--admin-surface);
    border-bottom: 1px solid var(--admin-border);
    box-shadow: 0 1px 3px rgba(15, 23, 42, .05);
}

/* Linha de destaque no topo da navbar */
.main-header.navbar::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--admin-primary), var(--admin-violet), var(--admin-accent));
    z-index: 1;
}

.main-header .navbar-nav .nav-link {
    color: var(--admin-text);
    padding: .6rem .7rem;
    border-radius: 10px;
    transition: color .15s ease, background .15s ease;
}
.main-header .navbar-nav .nav-link:hover {
    color: var(--admin-primary);
    background: #eef0ff;
}

.navbar-title {
    color: var(--admin-text);
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: -.01em;
    margin-left: .4rem;
}

.badge-outline-primary {
    background: transparent;
    border: 1.5px solid var(--admin-primary);
    color: var(--admin-primary);
    font-weight: 700;
    font-size: .7rem;
    letter-spacing: .04em;
    padding: .45em .85em;
    border-radius: 999px;
}
.badge-outline-danger {
    background: transparent;
    border: 1.5px solid var(--admin-danger);
    color: var(--admin-danger);
    font-weight: 700;
    font-size: .7rem;
    letter-spacing: .04em;
    padding: .45em .85em;
    border-radius: 999px;
}

/* --------------------------------------------------------------------------
   Sidebar
   -------------------------------------------------------------------------- */
.main-sidebar {
    background: linear-gradient(180deg, var(--admin-sidebar-top) 0%, var(--admin-sidebar-bottom) 100%) !important;
}

.brand-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: transparent !important;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    color: #fff;
    min-height: 3.5rem;
}
.brand-link:hover {
    color: #fff;
}
.brand-icon {
    font-size: 1.1rem;
    color: #fff;
    background: linear-gradient(135deg, var(--admin-primary), var(--admin-violet));
    padding: .5rem;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(79, 70, 229, .4);
}
.brand-text {
    font-weight: 700 !important;
    font-size: 1.05rem;
    letter-spacing: .02em;
}

/* Painel do usuário */
.user-panel {
    margin: .5rem .9rem 0;
    padding: 0 .5rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.user-panel .user-name {
    color: #fff;
    font-weight: 600;
    font-size: .95rem;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.user-panel .user-name:hover {
    color: #c7d2fe;
}
.user-panel .user-email {
    color: rgba(255, 255, 255, .5);
    font-size: .75rem;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Menu */
.sidebar-section {
    color: rgba(255, 255, 255, .38);
    font-size: .62rem;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    margin: 1.1rem 1rem .3rem;
    padding: 0;
}

.sidebar .nav-sidebar > .nav-item > .nav-link {
    border-radius: 10px;
    margin: 2px .65rem;
    padding: .65rem .85rem;
    color: rgba(255, 255, 255, .72);
    transition: background .15s ease, color .15s ease, transform .15s ease;
}
.sidebar .nav-sidebar > .nav-item > .nav-link:hover {
    background: rgba(255, 255, 255, .08);
    color: #fff;
    transform: translateX(2px);
}
.sidebar .nav-sidebar > .nav-item > .nav-link.active {
    background: var(--admin-sidebar-active);
    color: #fff;
    box-shadow: 0 6px 18px rgba(79, 70, 229, .35);
}
.sidebar .nav-sidebar > .nav-item > .nav-link.active:hover {
    transform: none;
}
.sidebar .nav-sidebar .nav-icon {
    font-size: 1rem;
}

.nav-treeview {
    background: rgba(0, 0, 0, .22);
    border-radius: 12px;
    margin: 2px .65rem 6px;
    padding: .25rem;
}
.nav-treeview .nav-link {
    border-radius: 8px;
    color: rgba(255, 255, 255, .65);
    padding: .5rem .8rem;
}
.nav-treeview .nav-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, .07);
}
.nav-treeview .nav-link.active {
    color: #fff;
    background: rgba(255, 255, 255, .12);
}

/* --------------------------------------------------------------------------
   Conteúdo
   -------------------------------------------------------------------------- */
.content-wrapper {
    background: var(--admin-bg);
}
@media (min-width: 768px) {
    .content-wrapper {
        padding-top: .75rem;
    }
}

.content-header h1 {
    font-weight: 700;
    font-size: 1.55rem;
    letter-spacing: -.01em;
}
.content-header h6 {
    color: var(--admin-text-muted);
    font-weight: 500;
}

/* --------------------------------------------------------------------------
   Cards
   -------------------------------------------------------------------------- */
.card {
    border-radius: var(--admin-radius);
    border: 1px solid var(--admin-border);
    box-shadow: var(--admin-shadow);
}
.card-header {
    background: transparent;
    border-bottom: 1px solid var(--admin-border);
    padding: 1rem 1.25rem;
    font-weight: 600;
}
.card.card-hover {
    transition: transform .18s ease, box-shadow .18s ease;
}
.card.card-hover:hover {
    transform: translateY(-3px);
    box-shadow: var(--admin-shadow-lg);
}

/* --------------------------------------------------------------------------
   Botões
   -------------------------------------------------------------------------- */
.btn {
    border-radius: 10px;
    font-weight: 600;
    transition: transform .12s ease, box-shadow .15s ease, filter .15s ease;
}
.btn:hover {
    transform: translateY(-1px);
}
.btn:active {
    transform: translateY(0);
}
.btn-primary {
    background: linear-gradient(90deg, var(--admin-primary), var(--admin-violet));
    border: none;
    box-shadow: 0 4px 12px rgba(79, 70, 229, .28);
}
.btn-primary:hover {
    filter: brightness(1.06);
    box-shadow: 0 6px 16px rgba(79, 70, 229, .34);
}
.btn-success {
    box-shadow: 0 4px 12px rgba(16, 185, 129, .22);
}
.btn-success:hover {
    box-shadow: 0 6px 16px rgba(16, 185, 129, .28);
}
.btn-danger {
    box-shadow: 0 4px 12px rgba(239, 68, 68, .2);
}
.btn-info {
    box-shadow: 0 4px 12px rgba(6, 182, 212, .2);
}
.btn-sm {
    border-radius: 8px;
}

/* --------------------------------------------------------------------------
   Formulários
   -------------------------------------------------------------------------- */
.form-control,
.form-select,
.form-control-file {
    border-radius: 10px;
    border-color: #d7deea;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.form-control:focus,
.form-select:focus {
    border-color: var(--admin-primary);
    box-shadow: 0 0 0 .22rem rgba(79, 70, 229, .14);
}
.form-control::placeholder {
    color: #94a3b8;
}
.input-group-text {
    border-color: #d7deea;
    background: #f8fafc;
}
.input-group .input-group-text:first-child {
    border-top-left-radius: 10px;
    border-bottom-left-radius: 10px;
}
.input-group .form-control:last-child {
    border-top-right-radius: 10px;
    border-bottom-right-radius: 10px;
}
.input-group .form-control:first-child {
    border-top-left-radius: 10px;
    border-bottom-left-radius: 10px;
}
.input-group .input-group-text:last-child {
    border-top-right-radius: 10px;
    border-bottom-right-radius: 10px;
}

/* --------------------------------------------------------------------------
   Tabelas
   -------------------------------------------------------------------------- */
.table thead th {
    background: #f6f8fc;
    color: var(--admin-text-muted);
    text-transform: uppercase;
    font-size: .7rem;
    letter-spacing: .06em;
    border-bottom: 1px solid var(--admin-border);
    vertical-align: middle;
}
.table-hover tbody tr:hover {
    background: #f8faff;
}
.table-title h2 {
    font-weight: 700;
}

/* --------------------------------------------------------------------------
   Badges / Alerts
   -------------------------------------------------------------------------- */
.badge {
    border-radius: 999px;
    padding: .45em .75em;
    font-weight: 600;
}
.alert {
    border-radius: 12px;
    border: none;
    box-shadow: var(--admin-shadow);
}

/* --------------------------------------------------------------------------
   Modais
   -------------------------------------------------------------------------- */
.modal-content {
    border-radius: 18px;
    border: none;
    box-shadow: var(--admin-shadow-lg);
}
.modal-header {
    border-bottom: 1px solid var(--admin-border);
    border-radius: 18px 18px 0 0;
}
.modal-footer {
    border-top: 1px solid var(--admin-border);
    border-radius: 0 0 18px 18px;
}

/* --------------------------------------------------------------------------
   Dropdowns
   -------------------------------------------------------------------------- */
.dropdown-menu {
    border-radius: 12px;
    border: 1px solid var(--admin-border);
    box-shadow: var(--admin-shadow-lg);
    padding: .4rem;
}
.dropdown-item {
    border-radius: 8px;
    padding: .5rem .85rem;
    font-size: .9rem;
}
.dropdown-item:hover,
.dropdown-item:focus {
    background: #eef0ff;
    color: var(--admin-primary);
}
.dropdown-item i {
    margin-right: 6px;
    width: 1rem;
    text-align: center;
}

/* --------------------------------------------------------------------------
   Abas (tabs)
   -------------------------------------------------------------------------- */
.nav-tabs {
    border-bottom: 1px solid var(--admin-border);
}
.nav-tabs .nav-link {
    border: none;
    color: var(--admin-text-muted);
    font-weight: 600;
    padding: .65rem 1rem;
    border-bottom: 2px solid transparent;
    transition: color .15s ease, border-color .15s ease;
}
.nav-tabs .nav-link:hover {
    color: var(--admin-primary);
}
.nav-tabs .nav-link.active,
.nav-tabs .nav-item.show .nav-link {
    color: var(--admin-primary);
    border-bottom: 2px solid var(--admin-primary);
    background: transparent;
}

/* --------------------------------------------------------------------------
   Dashboard (home-admin)
   -------------------------------------------------------------------------- */
body .dashboard-item {
    border-radius: 16px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, .14);
    transition: transform .2s ease, box-shadow .2s ease;
    overflow: hidden;
}
body .dashboard-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 16px 32px rgba(15, 23, 42, .2);
}
body .dashboard-item.profit {
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    border: none;
}
body .dashboard-item.request {
    background: linear-gradient(135deg, #0ea5e9, #6366f1);
    border: none;
}
body .dashboard-item.pending_request {
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    border: none;
}
body .dashboard-item.pending_entry {
    background: linear-gradient(135deg, #10b981, #0ea5e9);
    border: none;
}
body .dashboard-item-body p {
    font-family: 'Inter', 'Montserrat', sans-serif;
}

/* --------------------------------------------------------------------------
   DataTables
   -------------------------------------------------------------------------- */
.dt-button {
    border-radius: 8px !important;
}
.dt-buttons {
    margin-bottom: .5rem;
}

/* --------------------------------------------------------------------------
   Responsivo
   -------------------------------------------------------------------------- */

/* Tablets (≤ 991px) */
@media (max-width: 991.98px) {
    .content-wrapper {
        padding: 1rem !important;
    }
    .brand-text {
        font-size: .95rem;
    }
}

/* Celulares (≤ 767px) */
@media (max-width: 767.98px) {
    .content-header h1 {
        font-size: 1.3rem;
    }
    .card-body {
        padding: 1rem;
    }
    .modal-dialog {
        margin: .5rem;
    }

    /* Tabelas ganham rolagem horizontal interna (sem estourar a tela).
       Páginas que transformam a tabela em cards no mobile (ex.: Minhas Rifas,
       Rifas Ativas) sobrescrevem isto com regras específicas por página. */
    table.table {
        display: block;
        width: 100%;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    /* DataTables: rolagem + controles centralizados */
    .dataTables_wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .dataTables_filter {
        float: none;
        text-align: center;
        margin-bottom: .6rem;
    }
    .dataTables_wrapper .dataTables_filter input {
        width: 100%;
    }
    .dt-buttons {
        display: flex;
        flex-wrap: wrap;
        gap: .3rem;
        justify-content: center;
        margin-bottom: .6rem;
    }

    /* Formulários mais confortáveis no celular */
    .btn {
        white-space: nowrap;
    }
    .form-group {
        margin-bottom: .9rem;
    }

    /* Dashboard empilhado */
    .dashboard-itens .dashboard-item {
        height: auto;
        min-height: 108px;
    }
    .dashboard-item-body {
        font-size: 1.25rem;
    }
    .dashboard-item-body i {
        font-size: 4.5rem;
        top: 14px;
    }
}

/* ==========================================================================
   Área do Afiliado (template Acorn) — mesma identidade visual do painel
   Aplicado às páginas que usam afiliados/layout/menuAfiliados.blade.php
   ========================================================================== */

.afiliado-main {
    background: var(--admin-bg);
    min-height: calc(100vh - var(--nav-size-slim, 76px));
    padding-bottom: 2rem;
}

/* Navbar do topo: branca com linha de destaque em gradiente */
.nav-container {
    background: var(--admin-surface) !important;
    border-bottom: 1px solid var(--admin-border);
    box-shadow: 0 1px 3px rgba(15, 23, 42, .05);
}
.nav-container::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--admin-primary), var(--admin-violet), var(--admin-accent));
    z-index: 2;
}
.nav-shadow {
    display: none !important;
}

/* Logo */
.nav-container .logo img {
    border-radius: 8px;
}

/* Menu */
.nav-container .menu-container .menu a {
    border-radius: 10px;
    margin: 2px 4px;
    padding: .6rem .85rem !important;
    color: var(--admin-text) !important;
    font-weight: 600;
    transition: background .15s ease, color .15s ease;
}
.nav-container .menu-container .menu a:hover {
    background: #eef0ff;
    color: var(--admin-primary) !important;
}
.nav-container .menu-container .menu a.active,
.nav-container .menu-container .menu a.active:hover {
    background: linear-gradient(90deg, var(--admin-primary), var(--admin-violet)) !important;
    color: #fff !important;
    box-shadow: 0 6px 18px rgba(79, 70, 229, .35);
}
.nav-container .menu-container .menu a .icon {
    color: inherit;
}

/* Nome do usuário no topo */
.nav-container .user-container .user .name {
    font-weight: 600;
    color: var(--admin-text);
}

/* Título da página */
.page-title-container h1 {
    font-weight: 700;
    letter-spacing: -.01em;
}

/* Painéis de ganhos (página Meus Ganhos) */
.afiliado-main .bg-primary {
    background: linear-gradient(135deg, #2563eb, #7c3aed) !important;
    color: #fff;
    border-radius: 16px !important;
    box-shadow: 0 10px 24px rgba(79, 70, 229, .25);
}
.afiliado-main .bg-primary a,
.afiliado-main .bg-primary a:hover {
    color: #fff;
    text-decoration: underline;
}
.afiliado-main .bg-warning {
    color: #1e293b;
    border-radius: 16px !important;
    box-shadow: 0 10px 24px rgba(245, 158, 11, .25);
}
.afiliado-main .bg-success {
    color: #fff;
    border-radius: 16px !important;
    box-shadow: 0 10px 24px rgba(16, 185, 129, .25);
}
.afiliado-main .bg-success a,
.afiliado-main .bg-success a:hover {
    color: #fff;
    text-decoration: underline;
}

/* Tabelas de dados (DataTables) */
.data-table-responsive-wrapper {
    border-radius: var(--admin-radius);
    box-shadow: var(--admin-shadow);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Responsivo — Área do Afiliado */
@media (max-width: 767.98px) {
    .page-title-container h1 {
        font-size: 1.4rem;
    }
    .data-table-responsive-wrapper {
        display: block;
        width: 100%;
        overflow-x: auto;
        white-space: nowrap;
    }
    .data-table-responsive-wrapper table {
        min-width: 640px;
    }
    .afiliado-main .bg-primary,
    .afiliado-main .bg-warning,
    .afiliado-main .bg-success {
        margin-bottom: 1rem;
    }
    .nav-container .menu-container .menu a {
        padding: .5rem .7rem !important;
    }
}
