/* css/business.css */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;600;700;800&family=Space+Grotesk:wght@400;700&display=swap');

:root {
    --main-color: #7300ff; 
    --color-dark: #111310;
    --text-grey: #a0a0a0;
    --bg-card: #16181b;
    --neon-green: #00e676;
    --neon-blue: #00c6ff;
}

* {
    padding: 0; margin: 0; box-sizing: border-box;
    list-style-type: none; text-decoration: none;
    font-family: 'Montserrat', sans-serif;
}

body { background: var(--color-dark); color: #fff; overflow-x: hidden; }

/* 🔥 ПРИХОВАНИЙ ЧЕКБОКС ДЛЯ МЕНЮ */
#sidebar-toggle { display: none; }

/* SIDEBAR */
.sidebar {
    width: 260px; position: fixed; left: 0; top: 0; height: 100%;
    background: #0f0f0f; border-right: 1px solid #222; z-index: 100;
    transition: left 300ms; /* Анімація виїзду */
}

.sidebar-header {
    height: 90px; padding: 1rem; color: #fff;
    display: flex; align-items: center; justify-content: center;
}

.sidebar-header h2 { 
    font-family: 'Space Grotesk', sans-serif; font-size: 1.3rem; 
    letter-spacing: 1px; white-space: nowrap; 
}
.sidebar-header .highlight { color: var(--main-color); }
.logo-icon { font-size: 1.5rem; color: var(--main-color); margin-right: 10px; }

.nav-links { margin-top: 1rem; }
.nav-links li { width: 100%; margin-bottom: 0.5rem; }
.nav-links a {
    padding: 1rem 1rem 1rem 2rem; display: flex; align-items: center; gap: 15px;
    color: #888; font-size: 1rem; font-weight: 600; transition: 0.3s;
    border-left: 4px solid transparent;
}
.nav-links li.active a, .nav-links a:hover {
    color: #fff; background: rgba(115, 0, 255, 0.05);
    border-left-color: var(--main-color);
}
.nav-links a i { font-size: 1.2rem; min-width: 25px; }
.nav-links .logout a { color: #ff4444; margin-top: 2rem; }
.nav-links .logout a:hover { border-left-color: #ff4444; background: rgba(255, 68, 68, 0.05); }

/* MAIN CONTENT */
.main-content {
    margin-left: 260px; padding: 2rem;
    background: var(--color-dark); min-height: 100vh;
    transition: margin-left 300ms;
}

/* HEADER */
header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 2rem;
}

/* 🔥 КНОПКА МЕНЮ (ГАМБУРГЕР) - Спочатку прихована */
.menu-toggle { display: none; } 
.menu-toggle label {
    display: inline-block; width: 40px; height: 40px; 
    border-radius: 50%; background: #222; color: #fff;
    display: flex; align-items: center; justify-content: center; 
    cursor: pointer; font-size: 1.2rem;
}

header h1 { 
    font-family: 'Space Grotesk', sans-serif; font-size: 1.8rem; color: #fff; font-weight: 700; 
}

.user-wrapper { display: flex; align-items: center; gap: 15px; }
.user-wrapper img { 
    border-radius: 50%; width: 50px; height: 50px; 
    border: 2px solid var(--main-color); object-fit: cover; 
}
.user-wrapper h4 { font-size: 1rem; color: #fff; margin-bottom: 2px; }
.user-wrapper small { display: inline-block; color: var(--text-grey); font-size: 0.85rem; }

/* STATS CARDS */
.cards {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); 
    grid-gap: 1.5rem; margin-bottom: 2rem;
}

.card-single {
    display: flex; justify-content: space-between; align-items: center;
    background: var(--bg-card); padding: 2rem; border-radius: 16px; 
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    transition: transform 0.3s;
}
.card-single:hover { transform: translateY(-5px); border-color: rgba(115, 0, 255, 0.3); }

.card-single h1 { font-family: 'Space Grotesk', sans-serif; font-size: 2rem; color: #fff; margin-bottom: 5px; font-weight: 700; }
.card-single span { color: var(--text-grey); font-size: 0.9rem; font-weight: 600; }

/* Яскраві іконки */
.card-icon { font-size: 2.5rem; opacity: 1; filter: drop-shadow(0 0 10px rgba(255,255,255,0.1)); }
.icon-money { color: var(--neon-green); text-shadow: 0 0 15px rgba(0, 230, 118, 0.4); }
.icon-ads { color: #00c6ff; text-shadow: 0 0 15px rgba(0, 198, 255, 0.4); }
.icon-sales { color: #d500f9; text-shadow: 0 0 15px rgba(213, 0, 249, 0.4); }
.icon-views { color: #ffab00; text-shadow: 0 0 15px rgba(255, 171, 0, 0.4); }

/* CHARTS */
.charts-grid {
    display: grid; grid-template-columns: 2fr 1fr; grid-gap: 1.5rem;
    margin-bottom: 2rem;
}

.chart-container {
    background: var(--bg-card); padding: 1.5rem;
    border-radius: 16px; border: 1px solid rgba(255, 255, 255, 0.05);
    display: flex; flex-direction: column;
}
.chart-container h3 { margin-bottom: 1.5rem; color: #fff; font-size: 1.1rem; }

/* 🔥 ОБГОРТКА ГРАФІКІВ (Фіксує висоту) */
.chart-wrapper { 
    position: relative; width: 100%; height: 300px; flex-grow: 1; 
}
/* Щоб canvas точно слухався розмірів */
.chart-wrapper canvas {
    width: 100% !important;
    height: 100% !important;
}

/* TABLE */
.card { background: var(--bg-card); border-radius: 16px; border: 1px solid rgba(255, 255, 255, 0.05); }
.card-header {
    padding: 1.5rem; border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex; justify-content: space-between; align-items: center;
}
.card-header h3 { font-size: 1.2rem; color: #fff; }
.card-header button {
    background: var(--main-color); color: #fff; padding: 8px 16px;
    border-radius: 8px; border: none; cursor: pointer; font-weight: 700;
    transition: 0.3s;
}
.card-header button:hover { background: #5e00d1; box-shadow: 0 0 10px rgba(115, 0, 255, 0.4); }

.card-body { padding: 1rem; }
.table-responsive { width: 100%; overflow-x: auto; } /* Горизонтальний скрол */
table { border-collapse: collapse; width: 100%; min-width: 600px; } /* Мінімальна ширина */

thead tr { border-bottom: 1px solid rgba(255,255,255,0.1); }
thead td { font-weight: 700; padding: 1rem; color: var(--text-grey); font-size: 0.85rem; text-transform: uppercase; }
tbody tr { border-bottom: 1px solid rgba(255,255,255,0.03); }
tbody td { padding: 1rem; font-size: 0.95rem; color: #fff; vertical-align: middle; }

.status-badge {
    padding: 5px 12px; border-radius: 20px; font-size: 0.8rem; font-weight: 700;
    display: inline-flex; align-items: center; gap: 6px;
}
.status-badge.sold { background: rgba(0, 230, 118, 0.15); color: var(--neon-green); border: 1px solid var(--neon-green); }

/* ========================================= */
/* 🔥 АДАПТИВНІСТЬ (MOBILE FIRST) 🔥         */
/* ========================================= */

/* Планшети (до 960px) */
@media only screen and (max-width: 960px) {
    .charts-grid { grid-template-columns: 1fr; }
    .chart-wrapper { height: 280px; }
}

/* Телефони (до 768px) */
@media only screen and (max-width: 768px) {
    
    /* 1. Ховаємо сайдбар за лівий край */
    .sidebar { left: -100%; width: 260px; z-index: 999; }
    
    /* 2. Основний контент на всю ширину */
    .main-content { margin-left: 0; width: 100%; padding: 1rem; }
    
    /* 3. Показуємо кнопку меню */
    .menu-toggle { display: block; }
    header h1 { display: none; } /* Ховаємо заголовок, щоб влізло */
    
    /* 4. Коли чекбокс активний - показуємо сайдбар */
    #sidebar-toggle:checked ~ .admin-container .sidebar { left: 0; box-shadow: 10px 0 50px rgba(0,0,0,0.5); }
    
    /* 5. Затемнення фону при відкритому меню */
    #sidebar-toggle:checked ~ .admin-container .main-content::before {
        content: ""; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
        background: rgba(0,0,0,0.5); z-index: 90; backdrop-filter: blur(3px);
    }

    /* 6. Адаптація карток */
    .cards { grid-template-columns: 1fr; gap: 1rem; }
    
    /* 7. Адаптація хедера профілю */
    .user-wrapper img { width: 40px; height: 40px; }
    .user-wrapper h4 { font-size: 0.9rem; }
    .user-wrapper small { font-size: 0.75rem; }

    /* 8. Глобальна ширина та відступи */
    body { width: 100%; overflow-x: hidden; }
    .main-content { padding: 12px 16px; box-sizing: border-box; }
    .card-single { padding: 16px; }
    .card-header button { min-height: 44px; }
}