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

:root {
    --sidebar-width: 280px;
    --header-height: 70px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-admin);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
}

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

.sidebar-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 24px;
    border-bottom: 1px solid var(--border);
}

.sidebar-brand {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-main);
    text-decoration: none;
    letter-spacing: -0.5px;
}
.sidebar-brand span {
    color: var(--primary);
}

.sidebar-nav {
    padding: 24px 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow-y: auto;
}

.sidebar-category {
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 1px;
    margin-top: 16px;
    margin-bottom: 4px;
    padding-left: 16px;
    opacity: 0.7;
}
.sidebar-category:first-child {
    margin-top: 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.nav-item i {
    font-size: 1.1rem;
    opacity: 0.8;
}

.nav-item:hover {
    background: var(--surface);
    color: var(--text-main);
}

.nav-item.active {
    background: var(--primary-glow);
    color: var(--primary);
    font-weight: 600;
}
.nav-item.active i {
    opacity: 1;
}

.sidebar-footer {
    padding: 24px;
    border-top: 1px solid var(--border);
}

.vendor-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.vendor-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #ec4899);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
}

.vendor-info {
    display: flex;
    flex-direction: column;
}
.vendor-name { font-weight: 600; font-size: 0.9rem; }
.vendor-tier { font-size: 0.75rem; color: var(--primary); font-weight: 700; text-transform: uppercase; letter-spacing: 1px; }

/* Main Content Area */
.admin-main {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.admin-header {
    height: var(--header-height);
    background: var(--navbar-bg, rgba(255, 255, 255, 0.95));
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-search {
    display: flex;
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 16px;
    width: 300px;
    gap: 10px;
    color: var(--text-muted);
}
.header-search input {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-main);
    width: 100%;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.btn-icon {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-muted);
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}
.btn-icon:hover {
    background: var(--surface-hover);
    color: var(--text-main);
}

/* Content Container */
.admin-content {
    padding: 40px;
    flex: 1;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 32px;
}

.page-title {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.5px;
    margin-bottom: 8px;
}
.page-sub {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Cards */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    transition: all 0.3s ease;
}

.card:hover {
    border-color: rgba(255,255,255,0.15);
    box-shadow: 0 8px 30px rgba(0,0,0,0.4);
    transform: translateY(-2px);
}

/* Grid Layouts */
.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

/* Stats */
.stat-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.stat-label {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
}
.stat-value {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--text-main);
    display: flex;
    align-items: baseline;
    gap: 8px;
}
.stat-value span {
    font-size: 1rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Tables */
.table-container {
    width: 100%;
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.admin-table th {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 16px;
    border-bottom: 1px solid var(--border);
}

.admin-table td {
    padding: 16px;
    border-bottom: 1px solid rgba(255,255,255,0.02);
    color: var(--text-main);
    font-size: 0.95rem;
}

.admin-table tr:hover td {
    background: rgba(255,255,255,0.02);
}

/* Badges */
.badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.badge-purple { background: rgba(168, 85, 247, 0.15); color: #d8b4fe; }
.badge-blue { background: rgba(99, 102, 241, 0.15); color: #a5b4fc; }
.badge-green { background: rgba(46, 204, 113, 0.15); color: #a7f3d0; }
.badge-red { background: rgba(239, 68, 68, 0.15); color: #fca5a5; }
.badge-orange { background: rgba(245, 158, 11, 0.15); color: #fcd34d; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    gap: 8px;
}

.btn-primary {
    background: var(--primary);
    color: white;
}
.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--primary-glow);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
}
.btn-danger:hover {
    background: rgba(239, 68, 68, 0.2);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-main);
}
.btn-outline:hover {
    background: var(--surface);
    border-color: rgba(255,255,255,0.2);
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.6);
    backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--bg-admin);
    padding: 32px;
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    border: 1px solid var(--border);
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    animation: modalSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    max-height: 85vh;
    overflow-y: auto;
}

@keyframes modalSlideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-main);
    font-size: 0.95rem;
    transition: all 0.2s;
    font-family: 'Inter', sans-serif;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23a1a1aa'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 16px;
    padding-right: 40px;
}

/* Mobile Responsiveness for Admin Panel */
.mobile-nav-toggle {
    display: none;
    position: fixed;
    top: 15px;
    left: 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-main);
    padding: 8px 12px;
    font-size: 1.25rem;
    cursor: pointer;
    z-index: 1010; /* Above header */
}

/* Overlay for mobile sidebar */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.5);
    z-index: 999;
}
.sidebar-overlay.show { display: block; }

@media (max-width: 768px) {
    .mobile-nav-toggle { display: block; }
    
    .admin-sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    .admin-sidebar.open {
        transform: translateX(0);
    }
    
    .admin-main {
        margin-left: 0;
        width: 100vw;
    }
    
    .admin-header {
        padding-left: 70px; /* Room for toggle button */
        padding-right: 20px;
    }
    
    .header-search { display: none; }
    
    div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }
    
    .table-container, .admin-table-wrapper {
        overflow-x: auto;
    }
    
    .admin-content {
        padding: 16px;
    }
    
    .card {
        padding: 16px;
    }
    
    .stat-card {
        padding: 16px;
    }
    
    .modal-content {
        max-height: 70vh;
        padding-bottom: 80px; /* Extra ruimte zodat Safari toolbar de knoppen niet bedekt */
    }
}
