:root {
    --primary: #3DFE02;
    --primary-glow: rgba(61, 254, 2, 0.15);
    --bg-dark: #121212;
    --bg-sidebar: #1C1C1C;
    --bg-card: #1E1E1E;
    --bg-input: #2D2D2D;
    --text-main: #FFFFFF;
    --text-dim: #999999;
    --border: rgba(255, 255, 255, 0.05);
    --radius-lg: 8px;
    --radius-md: 4px;
    
    /* Stats Colors from Image */
    --stat-red: #F44336;
    --stat-orange: #FFB300;
    --stat-green: #2E7D32;
    --stat-blue: #1E88E5;
    /* Hover effect colors */
    --hover-secondary: #D32F2F;
    --hover-tertiary: #B71C1C;
}

html {
    overflow-x: hidden;
    box-sizing: border-box;
}

*, *::before, *::after {
    box-sizing: inherit;
}

/* Global resets for form elements and links */
a {
    color: inherit;
    text-decoration: none;
}

input, select, textarea, button {
    font-family: inherit;
    color: inherit;
}

select.form-hound-control,
input.form-hound-control,
textarea.form-hound-control {
    -webkit-appearance: none;
    appearance: none;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    margin: 0;
    display: flex;
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

/* Sidebar */
.sidebar {
    width: 250px;
    background: var(--bg-sidebar);
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 1000;
}

.sidebar-header {
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border);
}

.sidebar-logo {
    height: 32px;
    width: auto;
}

.sidebar-menu {
    flex: 1;
    padding: 20px 0;
    overflow-y: auto;
}

.menu-section {
    padding: 0 20px;
    margin-bottom: 25px;
}

.menu-label {
    font-size: 11px;
    font-weight: 800;
    color: var(--stat-red);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
    display: block;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--text-dim);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    margin-bottom: 4px;
}

.menu-item:hover, .menu-item.active {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
}

.menu-item.active {
    border-left: 3px solid var(--stat-red);
    color: #fff;
    background: rgba(244, 67, 54, 0.1);
}

.menu-item i {
    width: 18px;
    height: 18px;
}

/* Main Content Area */
.main-content {
    margin-left: 250px;
    flex: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow-x: hidden;
}

/* Top Navigation */
.top-nav {
    height: 64px;
    background: var(--bg-sidebar);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    position: sticky;
    top: 0;
    z-index: 900;
    color: var(--text-main);
}

.search-bar {
    display: flex;
    align-items: center;
    background: var(--bg-input);
    border-radius: 20px;
    padding: 8px 20px;
    width: 300px;
}

.search-bar input {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 14px;
    outline: none;
    width: 100%;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-link {
    color: var(--text-dim);
    text-decoration: none;
    transition: color 0.2s;
}

.nav-link:hover {
    color: #fff;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: var(--bg-input);
}

/* Page Content */
.content-body {
    padding: 30px;
    box-sizing: border-box;
    width: 100%;
    overflow-x: hidden;
}

/* Stats Cards Section */
.stats-grid-hound {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2px;
    margin-bottom: 30px;
    background: var(--border);
    border: 1px solid var(--border);
    box-sizing: border-box;
    width: 100%;
}

.hound-stat-card {
    padding: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stat-info .stat-value {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 5px;
}

.stat-info .stat-label {
    font-size: 12px;
    text-transform: uppercase;
    font-weight: 600;
    opacity: 0.8;
}

.stat-icon {
    opacity: 0.5;
}

/* Colors for Stats */
.card-red { background: var(--stat-red); color: #fff; }
.card-orange { background: var(--stat-orange); color: #fff; }
.card-green { background: var(--stat-green); color: #fff; }
.card-blue { background: var(--stat-blue); color: #fff; }

/* Dashboard Cards */
.hound-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 4px;
    margin-bottom: 30px;
}

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

.card-title-hound {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
}

.card-body-hound {
    padding: 20px;
}

/* Custom Table Styles */
.hound-table {
    width: 100%;
    border-collapse: collapse;
}

.hound-table th {
    text-align: left;
    padding: 12px 15px;
    font-size: 12px;
    text-transform: uppercase;
    color: var(--text-dim);
    border-bottom: 1px solid var(--border);
}

.hound-table td {
    padding: 15px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

/* Buttons */
.btn-hound {
    position: relative;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    overflow: hidden;
    z-index: 1;
    color: #fff;
    transition: all 0.3s;
}

.btn-hound i, .btn-hound span, .btn-hound div {
    position: relative;
    z-index: 3;
}

.btn-hound::before, .btn-hound::after {
    content: '';
    position: absolute;
    height: 1px;
    width: 1px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    border-radius: 50%;
}

.btn-hound::before {
    background: var(--hover-secondary);
    transition: 0.6s ease-in;
    transition-delay: .1s;
}

.btn-hound::after {
    background: var(--hover-tertiary);
    transition: 0.8s ease;
    transition-delay: .4s;
}

.btn-hound:hover::before, .btn-hound:hover::after {
    transform: translate(-50%, -50%) scale(310);
}


.btn-hound-primary {
    background: var(--stat-red);
    color: #fff;
}

/* Form Styles */
.form-hound-group {
    margin-bottom: 20px;
}

.form-hound-group label {
    display: block;
    font-size: 12px;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--text-dim);
    margin-bottom: 8px;
}

.form-hound-control {
    width: 100%;
    box-sizing: border-box;
    background: var(--bg-input);
    border: 1px solid var(--border);
    padding: 12px;
    color: #fff;
    border-radius: 4px;
    outline: none;
}

.form-hound-control:focus {
    border-color: var(--stat-red);
}

/* ─── Mobile Utility Classes ─────────────────── */

/* Hamburger button – hidden on desktop */
.mob-menu-btn {
    display: none;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 6px;
    border-radius: 4px;
    flex-shrink: 0;
}
.mob-menu-btn:hover { background: rgba(255,255,255,0.08); }

/* Sidebar close (X) button – hidden on desktop */
.sidebar-close-btn {
    display: none;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    padding: 4px;
    margin-left: auto;
    border-radius: 4px;
    flex-shrink: 0;
}
.sidebar-close-btn:hover { color: #fff; }

/* Full-screen overlay behind open sidebar */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    z-index: 999;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}
.sidebar-overlay.open { display: block; }

/* Prevent body scroll when sidebar drawer is open */
body.sidebar-open { overflow: hidden; }

/* ─── Breakpoints ─────────────────────────────── */

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

@media (max-width: 768px) {
    /* Sidebar: slide-in drawer */
    .sidebar {
        display: flex !important;
        transform: translateX(-260px);
        transition: transform 0.25s cubic-bezier(.4, 0, .2, 1);
        z-index: 1001;
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.6);
    }
    .sidebar.open {
        transform: translateX(0);
    }

    /* Show close button inside sidebar on mobile */
    .sidebar-close-btn { display: flex; }

    /* Main content: no sidebar offset */
    .main-content { margin-left: 0; width: 100%; max-width: 100vw; overflow-x: hidden; }

    /* Hide search bar, settings, go-to-website on mobile */
    .mob-hide-nav { display: none !important; }

    /* Top nav */
    .top-nav { padding: 0 14px; gap: 10px; }
    .mob-menu-btn { display: flex; }
    .search-bar { flex: 1; min-width: 0; width: auto; padding: 8px 14px; }
    .nav-actions { gap: 8px; }

    /* Stats: 2-column on tablets */
    .stats-grid-hound { grid-template-columns: repeat(2, 1fr); }
    .hound-stat-card { padding: 18px; }
    .stat-info .stat-value { font-size: 22px; }

    /* Content padding */
    .content-body { padding: 16px; box-sizing: border-box; overflow-x: hidden; }
    .card-body-hound { padding: 20px 16px; }
    .card-header-hound { padding: 14px 16px; }

    /* Tables: horizontal scroll container */
    .hound-table { min-width: 560px; }

    /* Card header wrap when button + title are tight */
    .card-header-hound { gap: 10px; }
}

@media (max-width: 480px) {
    /* Stats: KEEP 2-column even on small phones */
    .stats-grid-hound { grid-template-columns: repeat(2, 1fr); }
    .hound-stat-card { padding: 14px 12px; }
    .stat-info .stat-value { font-size: 20px; }
    .stat-info .stat-label { font-size: 10px; }
    .stat-icon { display: none; }

    /* Top nav */
    .top-nav { padding: 0 10px; height: 56px; }

    /* Content */
    .content-body { padding: 12px; box-sizing: border-box; overflow-x: hidden; }
    .card-body-hound { padding: 16px 12px; }
    .card-header-hound { padding: 12px; }

    /* Smaller buttons */
    .btn-hound { font-size: 12px; padding: 7px 12px; }
}

/* ─── Collapsible Section Toggle ─────────────── */
.section-toggle-btn {
    background: none;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 0;
    transition: color .2s;
}
.section-toggle-btn:hover { color: #fff; }
.section-toggle-btn .toggle-chevron { transition: transform .25s; }
.section-toggle-btn.open .toggle-chevron { transform: rotate(180deg); }

.collapsible-body {
    overflow: hidden;
    transition: max-height .3s cubic-bezier(.4,0,.2,1);
    max-height: 0;
}
.collapsible-body.open { max-height: 9999px; }

/* ─── Mobile Product Cards (replaces table on small screens) ── */
@media (max-width: 768px) {
    /* Hide the desktop table */
    .mob-hide { display: none !important; }

    /* Show mobile card list */
    .product-card-list { display: flex; flex-direction: column; gap: 10px; padding: 10px 0; width: 100%; box-sizing: border-box; }

    .prod-mob-card {
        background: var(--bg-input);
        border: 1px solid var(--border);
        border-radius: 8px;
        padding: 12px;
        display: flex;
        align-items: flex-start;
        gap: 12px;
        box-sizing: border-box;
        width: 100%;
        min-width: 0;
    }
    .prod-mob-thumb {
        width: 48px; height: 48px;
        border-radius: 6px;
        overflow: hidden;
        flex-shrink: 0;
        background: #2D2D2D;
        display: flex; align-items: center; justify-content: center;
    }
    .prod-mob-thumb img { width: 100%; height: 100%; object-fit: cover; }
    .prod-mob-info { flex: 1; min-width: 0; }
    .prod-mob-name { font-size: 13px; font-weight: 700; color: #fff; margin-bottom: 2px;
        white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .prod-mob-meta { font-size: 11px; color: var(--text-dim); margin-bottom: 6px; }
    .prod-mob-status-active   { color: #2E7D32; font-size: 11px; font-weight: 800; text-transform: uppercase; }
    .prod-mob-status-inactive { color: #F44336; font-size: 11px; font-weight: 800; text-transform: uppercase; }
    .prod-mob-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }
}

/* Desktop: hide mobile card list */
@media (min-width: 769px) {
    .product-card-list { display: none !important; }
    .hound-table-wrap { display: block !important; }
}

/* ─── Form 2-Column Grid (Edit/Add Product) ─── */
.form-grid-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
.form-grid-2col .span-2 { grid-column: span 2; }

@media (max-width: 640px) {
    .form-grid-2col {
        grid-template-columns: 1fr;
        gap: 0;
    }
    .form-grid-2col .span-2 { grid-column: span 1; }

    /* Card header: stack title + action button on mobile */
    .card-header-hound {
        flex-wrap: wrap;
        gap: 8px;
    }
    .card-header-hound .card-title-hound {
        flex: 1 1 100%;
        font-size: 14px;
    }
    .card-header-hound .btn-hound {
        font-size: 12px;
        padding: 7px 12px;
    }

    /* Product banner upload area: less padding on mobile */
    .upload-area-hound {
        padding: 20px !important;
    }
}
