/* ==========================================================================
   MATINA PLAST - ADMIN DASHBOARD
   ========================================================================== */

   :root {
    --admin-bg: #f8fafc;
    --admin-sidebar: #0f172a;
    --admin-card: #ffffff;
    --admin-border: #e2e8f0;
    --admin-text: #334155;
    --admin-title: #0f172a;
    --admin-primary: #ff4d00;
    --admin-primary-hover: #e64500;
    --status-new-bg: #ffedd5;
    --status-new-text: #c2410c;
    --status-contacted-bg: #dcfce7;
    --status-contacted-text: #15803d;
}

body.admin-body {
    background-color: var(--admin-bg);
    color: var(--admin-text);
    font-family: 'Inter', sans-serif;
    margin: 0;
    padding: 0;
    height: 100vh;
    overflow: hidden;
}

.admin-layout {
    display: flex;
    height: 100vh;
}

/* Sidebar */
.admin-sidebar {
    width: 260px;
    background-color: var(--admin-sidebar);
    color: white;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
}

.sidebar-header {
    padding: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-header img {
    max-height: 40px;
}

.sidebar-nav {
    flex: 1;
    padding: 24px 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-item {
    padding: 12px 24px;
    color: #94a3b8;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.nav-item i {
    font-size: 1.25rem;
}

.nav-item:hover, .nav-item.active {
    color: white;
    background: rgba(255, 255, 255, 0.05);
}

.nav-item.active {
    border-left-color: var(--admin-primary);
    color: white;
}

.sidebar-footer {
    padding: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Main Content */
.admin-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.admin-topbar {
    background: var(--admin-card);
    padding: 20px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--admin-border);
}

.topbar-left h2 {
    color: var(--admin-title);
    font-size: 1.5rem;
    margin-bottom: 4px;
}

.topbar-left p {
    color: #64748b;
    font-size: 0.9rem;
}

.admin-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    color: var(--admin-title);
}

.admin-profile img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.admin-content {
    padding: 40px;
}

/* Metrics Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-bottom: 40px;
}

.metric-card {
    background: var(--admin-card);
    border: 1px solid var(--admin-border);
    border-radius: 12px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.metric-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.05);
    color: var(--admin-sidebar);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2rem;
}

.metric-info h3 {
    color: #64748b;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.metric-info h2 {
    color: var(--admin-title);
    font-size: 2rem;
    font-weight: 700;
}

/* Table Container */
.table-container {
    background: var(--admin-card);
    border: 1px solid var(--admin-border);
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.table-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--admin-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.table-header h3 {
    color: var(--admin-title);
    font-size: 1.1rem;
}

.btn-export {
    background: white;
    border: 1px solid var(--admin-border);
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--admin-text);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.btn-export:hover {
    background: #f1f5f9;
}

/* Table */
.leads-table {
    width: 100%;
    border-collapse: collapse;
}

.leads-table th {
    background: #f8fafc;
    text-align: left;
    padding: 16px 24px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--admin-border);
}

.leads-table td {
    padding: 16px 24px;
    font-size: 0.95rem;
    border-bottom: 1px solid var(--admin-border);
    color: var(--admin-text);
    vertical-align: middle;
}

.leads-table tr:last-child td {
    border-bottom: none;
}

.leads-table tr:hover {
    background: #f8fafc;
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-align: center;
}

.status-novo {
    background: var(--status-new-bg);
    color: var(--status-new-text);
}

.status-contatado {
    background: var(--status-contacted-bg);
    color: var(--status-contacted-text);
}

/* Actions */
.action-btn {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 1.25rem;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.action-btn:hover {
    color: var(--admin-primary);
    background: rgba(255, 77, 0, 0.1);
}

.action-btn.done:hover {
    color: #15803d;
    background: rgba(21, 128, 61, 0.1);
}

/* Empty State */
.empty-state {
    padding: 60px 20px;
    text-align: center;
    color: #64748b;
}

.empty-state i {
    font-size: 4rem;
    color: #cbd5e1;
    margin-bottom: 16px;
}

.empty-state p {
    font-size: 1.2rem;
    color: var(--admin-title);
    font-weight: 600;
    margin-bottom: 8px;
}

/* ==========================================================================
   LOGIN OVERLAY (PREMIUM REDESIGN)
   ========================================================================== */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #020617; /* Fundo extremamente escuro */
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

/* Bolhas flutuantes animadas (Blobs) */
.blob {
    position: absolute;
    filter: blur(80px);
    z-index: 1;
    opacity: 0.5;
    animation: floatBlob 10s infinite alternate ease-in-out;
}

.blob-1 {
    width: 400px;
    height: 400px;
    background: var(--admin-primary); /* Laranja Matina */
    top: -100px;
    right: -100px;
    border-radius: 50%;
}

.blob-2 {
    width: 500px;
    height: 500px;
    background: #3b82f6; /* Azul Escuro */
    bottom: -150px;
    left: -150px;
    border-radius: 50%;
    animation-delay: -5s;
}

@keyframes floatBlob {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(-30px, 50px) scale(1.1); }
}

/* Painel de Vidro (Glassmorphism) */
.login-box.glass-panel {
    position: relative;
    z-index: 10;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 50px 40px;
    border-radius: 24px;
    text-align: center;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    animation: loginEnter 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes loginEnter {
    0% { opacity: 0; transform: translateY(20px) scale(0.95); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

.login-box img {
    height: 55px;
    margin-bottom: 25px;
}

.login-box h3 {
    color: #ffffff;
    margin-bottom: 10px;
    font-size: 1.8rem;
    letter-spacing: -0.5px;
}

.login-box p {
    color: #94a3b8;
    margin-bottom: 30px;
    font-size: 0.95rem;
    line-height: 1.5;
}

.custom-select-wrapper {
    position: relative;
    width: 100%;
    margin-bottom: 15px;
}

.login-select, .login-box input {
    width: 100%;
    padding: 16px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    font-family: inherit;
    font-size: 1rem;
    color: white;
    outline: none;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.login-select {
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
}

.login-select option {
    background: #0f172a;
    color: white;
}

.login-select:focus, .login-box input:focus {
    border-color: var(--admin-primary);
    background: rgba(0, 0, 0, 0.5);
    box-shadow: 0 0 0 4px rgba(255, 77, 0, 0.15);
}

.select-icon {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: #94a3b8;
    font-size: 1.2rem;
}

.login-box input::placeholder {
    color: #64748b;
}

.login-box button {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--admin-primary), #ff7a00);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
    box-shadow: 0 10px 20px -10px rgba(255, 77, 0, 0.6);
}

.login-box button:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 25px -10px rgba(255, 77, 0, 0.8);
    background: linear-gradient(135deg, #ff7a00, var(--admin-primary));
}

/* ==========================================================================
   SALES MODAL (CRM)
   ========================================================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(2, 6, 23, 0.85);
    backdrop-filter: blur(5px);
    z-index: 10000;
    display: none;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.sales-modal {
    background: white;
    padding: 30px;
    border-radius: 16px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    text-align: center;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.modal-overlay.active .sales-modal {
    transform: translateY(0);
}

.sales-modal h3 {
    color: var(--admin-title);
    margin-bottom: 10px;
    font-size: 1.4rem;
}

.sales-modal p {
    color: #64748b;
    font-size: 0.9rem;
    margin-bottom: 25px;
}

.sales-input-group {
    position: relative;
    margin-bottom: 25px;
}

.sales-input-prefix {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-weight: 600;
    color: #0f172a;
    font-size: 1.2rem;
}

.sales-input {
    width: 100%;
    padding: 15px 15px 15px 45px;
    border: 2px solid var(--admin-border);
    border-radius: 12px;
    font-size: 1.2rem;
    font-weight: 700;
    color: #0f172a;
    outline: none;
    transition: all 0.2s;
    box-sizing: border-box;
}

.sales-input:focus {
    border-color: #22c55e;
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.1);
}

.modal-actions {
    display: flex;
    gap: 10px;
}

.btn-cancel {
    flex: 1;
    padding: 12px;
    background: #f1f5f9;
    color: #475569;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-cancel:hover {
    background: #e2e8f0;
}

.btn-confirm-sale {
    flex: 2;
    padding: 12px;
    background: #22c55e; /* Green for money */
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.btn-confirm-sale:hover {
    background: #16a34a;
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(34, 197, 94, 0.3);
}

/* Tabela Badges Extra */
.status-badge.status-vendido {
    background: #dcfce7;
    color: #16a34a;
}

.status-badge.status-perdido {
    background: #fee2e2;
    color: #dc2626;
}

.action-btn.btn-sell {
    color: #16a34a;
    background: rgba(22, 163, 74, 0.1);
}
.action-btn.btn-sell:hover {
    background: #16a34a;
    color: white;
}

.action-btn.btn-lose {
    color: #dc2626;
    background: rgba(220, 38, 38, 0.1);
}
.action-btn.btn-lose:hover {
    background: #dc2626;
    color: white;
}

.revenue-text {
    font-weight: 700;
    color: #16a34a;
}

/* ==========================================================================
   REPORTS MODULE
   ========================================================================== */
.reports-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 10px;
}

.chart-container {
    background: white;
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    border: 1px solid var(--admin-border);
    position: relative;
    height: 380px;
}

.chart-container h3 {
    color: var(--admin-title);
    margin-bottom: 20px;
    font-size: 1.1rem;
    font-weight: 600;
}

@media (max-width: 1024px) {
    .reports-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   FINANCIAL HERO (META & FATURAMENTO)
   ========================================================================== */
.finance-hero {
    background: linear-gradient(135deg, #0f172a, #1e293b);
    border-radius: 20px;
    padding: 30px 40px;
    margin-bottom: 20px;
    color: white;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.finance-hero::after {
    content: '';
    position: absolute;
    right: -50px;
    top: -50px;
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, rgba(255, 77, 0, 0.15) 0%, rgba(0,0,0,0) 70%);
    border-radius: 50%;
}

.finance-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    z-index: 2;
}

.finance-header h3 {
    font-size: 1.1rem;
    color: #94a3b8;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-goal-edit {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 8px 15px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.btn-goal-edit:hover {
    background: rgba(255, 255, 255, 0.2);
}

.finance-value {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 25px;
    z-index: 2;
    background: linear-gradient(90deg, #ffffff, #e2e8f0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

/* Nova Tríade Financeira */
.finance-triad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 25px;
    z-index: 2;
}

.triad-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 15px 20px;
}

.triad-item p {
    font-size: 0.8rem;
    color: #94a3b8;
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.triad-item h2 {
    font-size: 1.8rem;
    font-weight: 700;
}

.triad-revenue h2 { color: #fff; }
.triad-expenses h2 { color: #ef4444; }
.triad-profit h2 { color: #22c55e; }

.status-invest { background: rgba(59, 130, 246, 0.1); color: #3b82f6; }
.status-gasto { background: rgba(239, 68, 68, 0.1); color: #ef4444; }

.expense-type-select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--admin-border);
    border-radius: 10px;
    font-size: 1rem;
    color: var(--admin-title);
    background: #f8fafc;
    font-family: 'Inter', sans-serif;
    outline: none;
    transition: all 0.2s;
}

.expense-type-select:focus {
    border-color: var(--admin-primary);
    box-shadow: 0 0 0 3px rgba(255, 77, 0, 0.1);
}

.progress-container {
    width: 100%;
    z-index: 2;
}

.progress-stats {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: #cbd5e1;
    font-weight: 500;
}

.progress-bar-bg {
    width: 100%;
    height: 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--admin-primary), #ff7a00);
    border-radius: 10px;
    width: 0%; /* Injetado via JS */
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.progress-bar-fill.success {
    background: linear-gradient(90deg, #22c55e, #4ade80);
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.6);
}

/* Botões Premium (Nova Ação) */
.btn-new-lead {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: white;
    border: none;
    padding: 10px 22px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(34, 197, 94, 0.3);
    margin-right: 12px;
}

.btn-new-lead:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(34, 197, 94, 0.5);
}

.btn-new-expense {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    border: none;
    padding: 10px 22px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.btn-new-expense:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(239, 68, 68, 0.5);
}

/* Layout Dividido para Aba Caixa */
.expenses-dashboard {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 20px;
    align-items: start;
}

@media (max-width: 1024px) {
    .expenses-dashboard {
        grid-template-columns: 1fr;
    }
}

.fixed-costs-container {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--admin-border);
}

.fixed-cost-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: #f8fafc;
    border-radius: 8px;
    margin-bottom: 10px;
    border: 1px solid #e2e8f0;
}

.fixed-cost-info {
    display: flex;
    flex-direction: column;
}

.fixed-cost-title {
    font-weight: 600;
    color: var(--admin-title);
    font-size: 0.95rem;
}

.fixed-cost-value {
    color: #ef4444;
    font-weight: 700;
    font-size: 0.85rem;
}

.btn-add-fixed {
    width: 100%;
    padding: 10px;
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    border: 1px dashed #3b82f6;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 10px;
}

.btn-add-fixed:hover {
    background: rgba(59, 130, 246, 0.2);
}

/* Filtro Mensal */
.month-filter-container {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f1f5f9;
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.month-filter-container i {
    color: #64748b;
    font-size: 1.1rem;
}

.month-filter-select {
    border: none;
    background: transparent;
    font-weight: 600;
    color: var(--admin-title);
    font-size: 0.95rem;
    outline: none;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
}
