/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    --primary: #D4AF37;
    --primary-hover: #FCE682;
    --primary-light: rgba(212, 175, 55, 0.15);

    --text-main: #FDFEFE;
    --text-muted: #A3A3A3;

    --bg-main: #050505;
    --bg-card: rgba(30, 30, 30, 0.45);

    --border-color: rgba(212, 175, 55, 0.25);

    --shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 8px 16px rgba(0, 0, 0, 0.6);
    --shadow-lg: 0 16px 24px rgba(0, 0, 0, 0.8);

    --radius-md: 12px;
    --radius-lg: 20px;

    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    --glass-blur: blur(16px);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    color: var(--text-main);
    
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;

    background: radial-gradient(circle at top right, #1a1a1a 0%, var(--bg-main) 100%);
    background-attachment: fixed;
}

/* Layout */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background-color: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 1.5rem 0;
    position: fixed;
    height: 100vh;
    z-index: 10;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0 1.5rem 2rem;
    border-bottom: 1px solid var(--border-color);
}

.logo-icon {
    background: linear-gradient(135deg, #D4AF37, #FDE047);
    color: #000;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.025em;
}

.logo-text span {
    color: var(--primary);
}

.nav-menu {
    list-style: none;
    padding: 1.5rem 1rem 0 1rem;
    flex: 0 0 auto;
}

#hub-menu {
    padding-top: 0;
    flex: 1;
    overflow-y: auto;
}

.mt-4 {
    margin-top: 1rem;
}

.nav-header {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    padding-left: 0.5rem;
}

.nav-item {
    margin-bottom: 0.5rem;
}

.nav-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    color: var(--text-main);
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition);
    text-align: left;
}

.nav-btn-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.nav-btn:hover {
    
}

.nav-btn.active {
    background-color: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
}

.nav-btn.active .lucide {
    color: var(--primary);
}

.lucide {
    width: 20px;
    height: 20px;
    color: var(--text-muted);
}

.badge {
    background-color: var(--border-color);
    font-size: 0.75rem;
    padding: 0.1rem 0.6rem;
    border-radius: 999px;
    color: var(--text-muted);
}

.nav-btn.active .badge {
    background-color: rgba(212, 175, 55, 0.2);
    color: var(--primary);
}

/* Upload Section */
.upload-section {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
    margin-top: auto;
}

.upload-section p {
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 600;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
}

.dataset-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    color: var(--text-main);
}

.dataset-info .lucide {
    color: var(--primary);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 280px;
    padding: 2.5rem;
    max-width: 1200px;
}

.top-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
}

.header-titles h2 {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.025em;
    margin-bottom: 0.5rem;
}

.header-titles p {
    color: var(--text-muted);
    font-size: 1.05rem;
}

.header-actions {
    display: flex;
    gap: 1rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition);
    border: none;
}

.btn-primary {
    background-color: var(--primary);
    color: #000;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.btn-primary .lucide {
    color: #000;
}

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-main);
}

.btn-outline:hover {
    
}

/* Dashboard Content */
.dashboard-content {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
}

.stat-card {
    background-color: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.stat-icon {
    width: 40px;
    height: 40px;
    background-color: var(--primary-light);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.5rem;
}

.stat-icon .lucide {
    color: var(--primary);
}

.stat-title {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 500;
}

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.05em;
}

/* Glass Panel / Data View */
.glass-panel {
    background-color: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.view-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.2);
}

.view-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
}

.search-box {
    display: flex;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.5rem 1rem;
    width: 300px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.search-box:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.search-box input {
    border: none;
    outline: none;
    padding-left: 0.75rem;
    width: 100%;
    font-size: 0.95rem;
    font-family: inherit;
    background: transparent;
    color: var(--text-main);
}

.view-body {
    padding: 1.5rem;
    min-height: 400px;

    background: radial-gradient(circle at top right, #1a1a1a 0%, var(--bg-main) 100%);
    background-attachment: fixed;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 300px;
    color: var(--text-muted);
    text-align: center;
}

.empty-state .lucide {
    width: 48px;
    height: 48px;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Data Listing Styles */
.region-group {
    margin-bottom: 2rem;
    animation: fadeIn 0.4s ease-out;
}

.region-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
    color: var(--primary);
}

.province-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.province-card {
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    background: rgba(40, 40, 40, 0.4);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
}

.province-header {
    font-weight: 600;
    font-size: 1.05rem;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.province-header .lucide {
    width: 16px;
    height: 16px;
}

.city-group {
    margin-left: 1rem;
    margin-top: 0.5rem;
    border-left: 2px solid var(--primary-light);
    padding-left: 1rem;
}

.city-header {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.store-card {
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    background: rgba(30, 30, 30, 0.5);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-bottom: 0.75rem;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.store-card:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-md);
    transform: translateX(4px);
}

.store-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.store-info-main {
    flex: 1;
}

.store-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.5rem;
}

.hub-badge {
    background: var(--primary);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.delivery-info {
    font-size: 0.75rem;
    color: #34D399;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(5, 150, 105, 0.2);
    padding: 2px 8px;
    border-radius: 4px;
}

.store-name {
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.store-name .lucide {
    color: var(--primary);
    width: 18px;
    height: 18px;
}

.store-address {
    font-size: 0.85rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-top: 0.25rem;
}

.store-address .lucide {
    width: 14px;
    height: 14px;
}

.products-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.5rem;
    font-size: 0.9rem;
}

.products-table th,
.products-table td {
    padding: 0.5rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.products-table th {
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    background: rgba(0, 0, 0, 0.3);
}

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

.kg-cell {
    text-align: right;
    font-weight: 600;
    color: var(--primary);
}

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

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

/* Responsive */
@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        padding: 1rem;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }

    .main-content {
        margin-left: 0;
        padding: 1rem;
    }

    .top-header {
        flex-direction: column;
        gap: 1rem;
    }

    .search-box {
        width: 100%;
    }
}

/* Nav Special Buttons & Badges */
.nav-special-btn {
    background: linear-gradient(135deg, rgba(84, 101, 255, 0.1) 0%, rgba(212, 175, 55, 0.05) 100%);
    border: 1px solid rgba(212, 175, 55, 0.2) !important;
    margin-top: 0.5rem;
}

.nav-special-btn:hover {
    background: linear-gradient(135deg, rgba(84, 101, 255, 0.2) 0%, rgba(212, 175, 55, 0.1) 100%) !important;
    border-color: var(--primary) !important;
}

#inbox-badge {
    background: #ef4444;
    color: white;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.4);
}

/* Inbox & Order Management */
.inbox-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.inbox-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    overflow: hidden;
    transition: var(--transition);
}

.inbox-card:hover {
    border-color: var(--primary-hover);
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-2px);
}

.inbox-card-header {
    background: rgba(212, 175, 55, 0.05);
    padding: 1.25rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.order-filename {
    font-weight: 700;
    font-size: 1rem;
    color: var(--primary);
}

.order-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.inbox-card-body {
    padding: 1.5rem;
}

.suggestion-box {
    background: rgba(212, 175, 55, 0.08);
    border-left: 4px solid var(--primary);
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 8px;
}

.suggestion-box p {
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    color: var(--primary);
}

.suggestion-alert {
    background: rgba(239, 68, 68, 0.1);
    border-left: 4px solid #ef4444;
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 8px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fca5a5;
}

.order-products {
    margin-top: 1.5rem;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.8rem;
}

.archive-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
    margin-top: 1.5rem;
}

.archive-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    padding: 1rem 1.25rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: var(--transition);
}

.archive-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--primary);
}

.archive-item i {
    color: var(--primary);
    opacity: 0.8;
}

.loader {
    width: 24px;
    height: 24px;
    border: 3px solid var(--primary-light);
    border-bottom-color: var(--primary);
    border-radius: 50%;
    display: inline-block;
    box-sizing: border-box;
    animation: rotation 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes rotation {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}