/* dashboard.css */

/* =========================================== */
/* CORES PADRÃO E VARIÁVEIS                   */
/* =========================================== */
:root {
    --primary: rgb(47, 5, 74);
    --primary-dark: rgb(155, 70, 229);
    --secondary: rgb(72, 67, 208);
    --secondary-dark: rgb(46, 7, 118);
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: rgb(0, 29, 75);
    --gray-dark: #1f2937;
    --gray: #6b7280;
    --gray-light: #f3f4f6;
    --card-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 
                    0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --transition: all 0.3s ease;
}

/* =========================================== */
/* CONTAINER DO DASHBOARD                      */
/* =========================================== */
.dashboard-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 15px;
}

/* =========================================== */
/* SESSÃO DE SAUDAÇÃO                          */
/* =========================================== */
.greeting-section {
    background: linear-gradient(120deg, #6366f1, #818cf8);
    color: white;
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: var(--card-shadow);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 80px;
}

.greeting-section::before {
    content: '';
    position: absolute;
    top: -50px;
    right: -50px;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
}

.greeting-section::after {
    content: '';
    position: absolute;
    bottom: -30px;
    left: 20%;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
}

.greeting-header {
    font-size: 2.2rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
}

.greeting-subheader {
    font-size: 1.2rem;
    opacity: 0.8;
}

/* =========================================== */
/* ESTATÍSTICAS RÁPIDAS (VERSÃO COMPACTA)      */
/* =========================================== */
.quick-stats {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.stat-card {
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    padding: 1rem;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    color: #ffffff;
    min-height: 100px;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 20px -5px rgba(0, 0, 0, 0.1), 
                0 5px 5px -2px rgba(0, 0, 0, 0.05);
}

.stat-card.primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
}
.stat-card.secondary {
    background: linear-gradient(135deg, var(--secondary), var(--secondary-dark));
}
.stat-card.info {
    background: linear-gradient(135deg, var(--info), #2563eb);
}
.stat-card.dark {
    background: linear-gradient(135deg, #374151, var(--gray-dark));
}

.stat-icon {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    font-size: 2rem;
    opacity: 0.15;
    color: #ffffff;
}

.stat-title {
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 0.3rem;
}

.stat-value {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 0.3rem;
}

.stat-subtitle {
    font-size: 0.8rem;
    opacity: 0.8;
    margin-bottom: 0.5rem;
}

.stat-trend {
    display: flex;
    align-items: center;
    font-size: 0.8rem;
    margin-top: auto;
}

.trend-up {
    color: rgb(0, 255, 0);
}

.trend-down {
    color: rgb(255, 50, 50);
}

.stat-progress {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    margin-top: 0.3rem;
    overflow: hidden;
}
.progress-bar {
    height: 100%;
    border-radius: 2px;
    background: #ffffff;
}

/* =========================================== */
/* DASHBOARD GRÁFICOS (AJUSTADO)               */
/* =========================================== */
.dashboard-charts {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.chart-container {
    width: 100%;
    height: 300px;
    position: relative;
    background: white;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
}

.chart-container canvas {
    width: 100% !important;
    height: auto !important;
    max-height: 250px;
    display: block;
}

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

.chart-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-dark);
}

.chart-actions {
    display: flex;
    gap: 0.3rem;
}

.chart-btn {
    background: var(--gray-light);
    border: none;
    border-radius: 4px;
    padding: 0.3rem 0.6rem;
    font-size: 0.8rem;
    cursor: pointer;
    transition: var(--transition);
}

.chart-btn:hover {
    background: #e5e7eb;
}

.chart-btn.active {
    background: var(--primary);
    color: white;
}

/* =========================================== */
/* PEDIDOS RECENTES                            */
/* =========================================== */
.recent-orders {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: var(--card-shadow);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

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

.orders-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--gray-dark);
}

.view-all {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}
.view-all:hover {
    color: var(--primary-dark);
}

.orders-table {
    width: 100%;
    border-collapse: collapse;
}

.orders-table th {
    text-align: left;
    padding: 0.75rem 1rem;
    font-weight: 500;
    color: var(--gray);
    border-bottom: 1px solid #e5e7eb;
}

.orders-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.customer-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.customer-avatar {
    width: 36px;
    height: 36px;
    background: var(--gray-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: var(--gray-dark);
}

.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-new {
    background: rgba(59, 130, 246, 0.1);
    color: #2563eb;
}
.status-preparing {
    background: rgba(245, 158, 11, 0.1);
    color: #d97706;
}
.status-completed {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
}

/* =========================================== */
/* INSIGHTS DO NEGÓCIO                         */
/* =========================================== */
.insights-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.insight-card {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: var(--card-shadow);
    padding: 1.5rem;
}

.insight-header {
    margin-bottom: 1rem;
}

.insight-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--gray-dark);
    margin-bottom: 0.25rem;
}

.insight-subtitle {
    font-size: 0.9rem;
    color: var(--gray);
}

.category-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.category-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.category-name {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.category-icon {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
}

.payment-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.payment-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0;
}

.payment-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.payment-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.payment-details {
    display: flex;
    flex-direction: column;
}
.payment-name {
    font-weight: 500;
}
.payment-count {
    font-size: 0.85rem;
    color: var(--gray);
}
.payment-amount {
    font-weight: 600;
}

/* =========================================== */
/* RESPONSIVIDADE                              */
/* =========================================== */
@media (max-width: 1024px) {
    .dashboard-charts {
        grid-template-columns: 1fr;
    }
    .insights-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .insights-grid {
        grid-template-columns: 1fr;
    }
    .quick-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .quick-stats {
        grid-template-columns: 1fr;
    }
}

/* =========================================== */
/* ANIMAÇÕES SIMPLES                           */
/* =========================================== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
    animation: fadeIn 0.5s ease-out forwards;
}

.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }
.delay-400 { animation-delay: 0.4s; }
.delay-500 { animation-delay: 0.5s; }

/* =========================================== */
/* NOTIFICAÇÕES E WIDGETS ADICIONAIS           */
/* =========================================== */
.notifications-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.notification-item {
  display: flex;
  align-items: flex-start;
  padding: 1rem;
  border-radius: 0.5rem;
  background-color: #f3f4f6;
  transition: background-color 0.2s;
}

.notification-item:hover {
  background-color: #e5e7eb;
}

.notification-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  margin-right: 1rem;
  flex-shrink: 0;
}

.bg-primary {
  background-color: #4f46e5;
}

.bg-warning {
  background-color: #f59e0b;
}

.bg-success {
  background-color: #10b981;
}

.notification-content {
  flex: 1;
}

.notification-title {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.notification-text {
  color: #6b7280;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.notification-time {
  font-size: 0.8rem;
  color: #9ca3af;
}

/* Widget do Tempo */
.weather-widget {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: white;
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
  margin-top: 2rem;
}

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

.weather-location {
  font-weight: 600;
  font-size: 1.1rem;
}

.weather-date {
  font-size: 0.9rem;
  opacity: 0.8;
}

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

.weather-temp {
  font-size: 2.5rem;
  font-weight: 700;
}

.weather-desc {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.weather-icon {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.weather-text {
  font-size: 0.9rem;
}

.weather-details {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.weather-detail {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(255, 255, 255, 0.1);
  padding: 0.75rem;
  border-radius: 0.5rem;
}

.detail-icon {
  margin-bottom: 0.5rem;
  font-size: 1.25rem;
}

.detail-value {
  font-weight: 600;
  font-size: 0.9rem;
}

.detail-label {
  font-size: 0.8rem;
  opacity: 0.8;
}

/* Animação de Pulso */
@keyframes pulseEffect {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

.pulse-animation {
  animation: pulseEffect 2s infinite;
}

/* Tooltip Personalizado */
.custom-tooltip {
  position: relative;
  display: inline-block;
  cursor: pointer;
}

.custom-tooltip .tooltip-text {
  visibility: hidden;
  width: 200px;
  background-color: rgba(0, 0, 0, 0.8);
  color: #fff;
  text-align: center;
  border-radius: 6px;
  padding: 10px;
  position: absolute;
  z-index: 1;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0;
  transition: opacity 0.3s;
}

.custom-tooltip .tooltip-text::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: rgba(0, 0, 0, 0.8) transparent transparent transparent;
}

.custom-tooltip:hover .tooltip-text {
  visibility: visible;
  opacity: 1;
}

/* --- Imported styles from view_products.php to unify across pages (added by script) --- */

        .main-container {
            background: #f1f3f4;
            min-height: 100vh;
            padding: 1.5rem 0;
        }
        
        .custom-card {
            background: white;
            border: 1px solid #e0e3e7;
            border-radius: 15px;
            box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
            transition: all 0.3s ease;
        

    overflow: hidden;
}
        
        .custom-card:hover {
            transform: translateY(-5px);
            box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
        }
        
        .card-header {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: #fff !important;
            border: none;
            border-radius: 20px 20px 0 0;
            padding: 1.25rem;
            font-weight: 600;
            text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
        
    margin: -2px -2px 0 -2px;
}
        
        .filter-panel {
            background: white;
            border-radius: 12px;
            padding: 1.25rem;
            margin-bottom: 1.5rem;
            border: 1px solid #e9ecef;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
        }
        
        .product-card {
            background: white;
            border: 1px solid #e9ecef;
            border-radius: 12px;
            overflow: hidden;
            transition: all 0.3s ease;
            position: relative;
            height: 100%;
            box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
        }
        
        .product-card:hover {
            transform: translateY(-8px);
            box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
        }
        
        .product-card .card-header {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            padding: 1rem;
            font-size: 0.95rem;
            font-weight: 600;
            text-align: center;
            position: relative;
        
    border-radius: 20px 20px 0 0;

    margin: -2px -2px 0 -2px;

    color: #fff !important;
}
        
        .product-card .card-body {
            padding: 1.25rem;
            display: flex;
            flex-direction: column;
            height: 100%;
            position: relative;
        }
        
        .delete-icon {
            position: absolute;
            top: 15px;
            right: 15px;
            color: #ff4757;
            font-size: 1.2rem;
            cursor: pointer;
            background: rgba(255, 255, 255, 0.9);
            width: 35px;
            height: 35px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.3s ease;
            box-shadow: 0 4px 15px rgba(255, 71, 87, 0.3);
        }
        
        .delete-icon:hover {
            background: #ff4757;
            color: white;
            transform: scale(1.1);
        }
        
        .product-image {
            width: 100px !important;
            height: 100px !important;
            object-fit: cover;
            border-radius: 12px;
            margin: 0 auto 1rem auto;
            border: 3px solid #f8f9fa;
            transition: all 0.3s ease;
        }
        
        .product-image:hover {
            transform: scale(1.05);
            border-color: #667eea;
        }
        
        .card-text {
            color: #555;
            line-height: 1.6;
        }
        
        .price-text {
            font-size: 1.1rem;
            font-weight: 700;
            color: #2ed573;
            background: linear-gradient(135deg, #2ed573, #17c0eb);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
        }
        
        .card-footer {
            background: #f8f9fa;
            border: none;
            padding: 1rem;
            border-radius: 0 0 15px 15px;
        }
        
        .btn {
            border-radius: 8px;
            font-weight: 500;
            padding: 0.5rem 1rem;
            transition: all 0.3s ease;
            border: none;
            position: relative;
            overflow: hidden;
        }
        
        .btn::before {
            content: '';
            position: absolute;
            top: 0;
            left: -100%;
            width: 100%;
            height: 100%;
            background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
            transition: left 0.5s;
        }
        
        .btn:hover::before {
            left: 100%;
        }
        
        .btn-primary {
            background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
            box-shadow: 0 4px 15px rgba(79, 172, 254, 0.4);
        }
        
        .btn-primary:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(79, 172, 254, 0.6);
        }
        
        .btn-secondary {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
        }
        
        .btn-secondary:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
        }
        
        .btn-danger {
            background: linear-gradient(135deg, #ff4757 0%, #ff3742 100%);
            box-shadow: 0 4px 15px rgba(255, 71, 87, 0.4);
        }
        
        .btn-danger:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(255, 71, 87, 0.6);
        }
        
        .btn-outline-secondary {
            border: 2px solid rgba(255, 255, 255, 0.8);
            color: white;
            background: rgba(255, 255, 255, 0.1);
            backdrop-filter: blur(10px);
        }
        
        .btn-outline-secondary:hover {
            background: rgba(255, 255, 255, 0.2);
            border-color: white;
            color: white;
        }
        
        .form-select {
            border-radius: 8px;
            border: 2px solid #e1e8ed;
            padding: 0.5rem 1rem;
            transition: all 0.3s ease;
        }
        
        .form-select:focus {
            border-color: #667eea;
            box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
        }
        
        .status-badge {
            position: absolute;
            top: 10px;
            left: 10px;
            padding: 0.25rem 0.75rem;
            border-radius: 15px;
            font-size: 0.75rem;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }
        
        .status-active {
            background: linear-gradient(135deg, #2ed573, #17c0eb);
            color: white;
        }
        
        .status-inactive {
            background: linear-gradient(135deg, #ff4757, #ff3742);
            color: white;
        }
        
        @media (max-width: 768px) {
            .main-container {
                padding: 1rem 0;
            }
            
            .custom-card {
                margin: 0 1rem;
            
    border-radius: 20px;

    overflow: hidden;
}
            
            .card-footer .btn {
                font-size: 0.8rem;
                padding: 0.4rem 0.8rem;
            }
        }
        
        .fade-in {
            animation: fadeIn 0.6s ease-in;
        }
        
        @keyframes fadeIn {
            from {
                opacity: 0;
                transform: translateY(30px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }
    

/* === Custom Fixes v2 === */
.custom-card {
    padding: 0 !important;          /* remove inner white padding that caused top/sides gap */

    border-radius: 20px;

    overflow: hidden;
}

.card.custom-card .card-body,
.card.custom-card .card-footer {
    padding: 1.5rem; /* keep body spacing */
}

.btn,
.btn-primary,
input.btn,
input.btn-primary {
    border: none !important;        /* remove unwanted dark border */
    outline: none !important;
    box-shadow: none !important;    /* remove bootstrap focus shadow */
}

.btn:focus,
.btn-primary:focus,
input.btn:focus,
input.btn-primary:focus {
    outline: none !important;
    box-shadow: none !important;
}

/* Ensure submit input inherits gradient style like buttons */
input[type="submit"].btn-primary {
    background: linear-gradient(135deg, #4facfe 0%, #38f9d7 100%);
    color: #fff;
}


/* Ensures gradient/card headers have white heading text */
.card-header h1,
.card-header h2,
.card-header h3,
.gradient-header h1,
.gradient-header h2,
.gradient-header h3 {
    color: #fff !important;
}
