/* =============================================================================
   PROJUNINO / FEQUAJUTO
   ESTILO MODERNO — PREMIUM DARK & GLASSMORPHISM
   ============================================================================= */

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

:root {
    /* Brand Palette */
    --brand-primary: #ffd54f;
    /* Gold */
    --brand-secondary: #ffb74d;
    /* Orange */
    --brand-success: #10b981;
    /* Emerald */
    --brand-danger: #ef4444;
    /* Red */
    --brand-info: #3b82f6;
    /* Blue */

    /* Backgrounds (Dark Mode) */
    --bg-main: #020617;
    /* Slate 950 */
    --bg-card: rgba(15, 23, 42, 0.95);
    /* More opaque Slate 900 */
    --bg-glass: rgba(255, 255, 255, 0.07);

    /* Text */
    --text-primary: #f8fafc;
    /* Slate 50 */
    --text-secondary: #cbd5e1;
    /* Slate 300 (Higher contrast) */
    --text-muted: #94a3b8;
    /* Slate 400 (Higher contrast) */

    /* UI Borders & Shadows */
    --glass-border: rgba(255, 255, 255, 0.08);
    --radius-lg: 16px;
    --radius-md: 10px;
    --shadow-premium: 0 20px 50px rgba(0, 0, 0, 0.5);

    /* Animation */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* =============================================================================
   BASE
   ============================================================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: 'Outfit', sans-serif;
    background: var(--bg-main);
    background-image:
        radial-gradient(at 0% 0%, rgba(30, 58, 138, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(136, 19, 55, 0.1) 0px, transparent 50%),
        url('../img/FundoJuninoProH.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: var(--text-primary);
    overflow-x: hidden;
}

/* =============================================================================
   NAVBAR
   ============================================================================= */
.navbar {
    background: rgba(2, 6, 23, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
    padding: 0.8rem 0;
    z-index: 1050;
}

.logo-topo {
    height: 42px;
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.1));
}

.navbar .nav-link {
    color: var(--text-secondary);
    font-weight: 500;
    transition: var(--transition);
}

.navbar .nav-link:hover,
.navbar .nav-link.active {
    color: var(--brand-primary);
}

/* =============================================================================
   CARDS & CONTAINERS
   ============================================================================= */
.main-wrapper {
    flex: 1;
    padding-top: 2rem;
    animation: fadeIn 0.6s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card-custom {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-premium);
    transition: var(--transition);
}

.card-custom:hover {
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-4px);
}

.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}
#chartSales {
    max-height: 300px !important;
}

/* =============================================================================
   PAGE TRANSITIONS
   ============================================================================= */
.page {
    display: none;
    animation: slideUp 0.4s ease-out;
}

.page.active {
    display: block;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =============================================================================
   TABLES GRID (PÚBLICO & ADMIN)
   ============================================================================= */
.tables-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(48px, 1fr));
    gap: 12px;
    padding: 10px;
}

.table-item {
    aspect-ratio: 1/1;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
    user-select: none;
    position: relative;
    overflow: hidden;
    border: 1px solid transparent;
}

.table-item::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), transparent);
    opacity: 0;
    transition: var(--transition);
}

.table-item:hover:not(.sold, .reserved, .pending) {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.table-item.free {
    background: rgba(16, 185, 129, 0.1);
    border-color: var(--brand-success);
    color: var(--brand-success);
}

.table-item.free:hover {
    background: var(--brand-success);
    color: white;
}

.table-item.reserved,
.table-item.pending {
    background: rgba(245, 158, 11, 0.15);
    border-color: var(--brand-secondary);
    color: var(--brand-secondary);
    cursor: not-allowed;
}

.table-item.sold,
.table-item.paid {
    background: var(--brand-danger);
    border-color: var(--brand-danger);
    color: white;
    cursor: not-allowed;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

.table-item.sold::after,
.table-item.paid::after {
    display: none;
}

/* =============================================================================
   KPI CARDS (ADMIN)
   ============================================================================= */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.kpi-card {
    background: var(--bg-glass);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: var(--transition);
}

.kpi-card:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-2px);
}

.kpi-icon {
    width: 48px;
    height: 48px;
    background: rgba(255, 213, 79, 0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.kpi-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    font-weight: 600;
}

.kpi-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--brand-primary);
}

/* =============================================================================
   FORMS & INPUTS
   ============================================================================= */
.form-control,
.form-select {
    background: rgba(15, 23, 42, 0.5) !important;
    border: 1px solid var(--glass-border) !important;
    color: white !important;
    border-radius: 8px;
    padding: 0.6rem 1rem;
    transition: var(--transition);
}

.form-control:focus,
.form-select:focus {
    background: rgba(15, 23, 42, 0.8) !important;
    border-color: var(--brand-primary) !important;
    box-shadow: 0 0 0 4px rgba(255, 213, 79, 0.1);
}

.form-label {
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

/* =============================================================================
   BUTTONS
   ============================================================================= */
.btn {
    border-radius: 8px;
    padding: 0.6rem 1.2rem;
    font-weight: 600;
    transition: var(--transition);
}

.btn-primary {
    background: var(--brand-info);
    border: none;
}

.btn-warning {
    background: var(--brand-primary);
    border: none;
    color: #000;
}

.btn-warning:hover {
    background: #fcd34d;
    transform: scale(1.02);
}

.btn-outline-light {
    border-color: var(--glass-border);
}

.btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: white;
}

/* =============================================================================
   MODAIS
   ============================================================================= */
.modal-content {
    background: rgba(15, 23, 42, 0.9) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.modal-header {
    border-bottom: 1px solid var(--glass-border);
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid var(--glass-border);
    padding: 1.2rem 1.5rem;
}

/* =============================================================================
   FOOTER
   ============================================================================= */
.footer-junino {
    margin-top: auto;
    padding: 2.5rem 0;
    background: rgba(2, 6, 23, 0.9);
    border-top: 1px solid var(--glass-border);
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 3rem;
    padding: 0 2rem;
}

.footer-logo img {
    height: 60px;
    opacity: 0.8;
}

.footer-texto {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* =============================================================================
   TOASTS (OVERRIDE BOOTSTRAP)
   ============================================================================= */
.toast {
    background: rgba(15, 23, 42, 0.9) !important;
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
}

/* =============================================================================
   RESPONSIVE DATA
   ============================================================================= */
@media (max-width: 768px) {
    .kpi-grid {
        gap: 1rem;
    }

    .tables-grid {
        grid-template-columns: repeat(auto-fill, minmax(42px, 1fr));
        gap: 8px;
    }

    .footer-container {
        flex-direction: column;
        text-align: center;
        gap: 1.5rem;
    }

    .logo-topo {
        height: 34px;
    }
}