:root {
    --bg-dark: #f1f5f9;
    --bg-card: #ffffff;
    --accent: #2563eb;
    --accent-glow: rgba(37, 99, 235, 0.1);
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --border: #e2e8f0;
    --glass: rgba(255, 255, 255, 0.9);
    --sidebar-width: 260px;
    --error: #ef4444;
}

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

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
}

h1, h2, h3 {
    font-family: 'Outfit', sans-serif;
}

/* Auth Overlay */
.overlay {
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, #e2e8f0 0%, #f1f5f9 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 2.5rem;
    border-radius: 20px;
    width: 400px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.logo-icon {
    font-size: 1.5rem;
    color: var(--accent);
    text-shadow: 0 0 10px var(--accent-glow);
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
}

.logo h1 span {
    color: var(--accent);
}

.login-header p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.input-group {
    margin-bottom: 1.5rem;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.input-group input {
    width: 100%;
    padding: 0.8rem 1rem;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: inherit;
    transition: all 0.2s;
}

.input-group input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-glow);
}

.btn-primary {
    width: 100%;
    padding: 0.8rem;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
}

.btn-primary:hover {
    background: #2563eb;
    transform: translateY(-1px);
}

.btn-ghost {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

.error-text {
    color: var(--error);
    font-size: 0.8rem;
    margin-top: 1rem;
    text-align: center;
}

/* Dashboard Layout */
.dashboard-container {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    height: 100vh;
}

.sidebar {
    background: #ffffff;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
}

.sidebar-header {
    margin-bottom: 2.5rem;
}

.nav-links {
    list-style: none;
    flex: 1;
}

.nav-links li {
    padding: 0.8rem 1rem;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.nav-links li:hover {
    color: var(--accent);
    background: var(--accent-glow);
}

.nav-links li.active {
    background: var(--accent-glow);
    color: var(--accent);
    font-weight: 600;
}

.content {
    background: var(--bg-dark);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.top-bar {
    padding: 1rem 2rem;
    background: var(--bg-dark);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.avatar {
    width: 32px;
    height: 32px;
    background: var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
}

.view {
    padding: 2rem;
    overflow-y: auto;
    flex: 1;
}

.controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.search-box {
    position: relative;
    width: 400px;
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
}

.search-box input {
    width: 100%;
    padding: 0.7rem 1rem 0.7rem 2.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: white;
    font-family: inherit;
}

.search-box input:focus {
    outline: none;
    border-color: var(--accent);
}

.stats-mini {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Glass Table */
.table-container {
    border-radius: 16px;
    overflow: hidden;
    background: var(--bg-card);
    border: 1px solid var(--border);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
}

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

th {
    background: #f8fafc;
    padding: 1rem 1.5rem;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border);
}

td {
    padding: 1rem 1.5rem;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
}

tr:hover td {
    background: #f8fafc;
}

/* Image Handling */
.model-gallery {
    display: flex;
    gap: 8px;
    align-items: center;
    overflow-x: auto;
    padding: 4px 0;
    max-width: 300px;
}

.model-gallery::-webkit-scrollbar {
    height: 4px;
}

.model-gallery::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 10px;
}

.model-gallery img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--border);
    cursor: pointer;
    background: #f1f5f9;
    transition: all 0.2s;
}

.model-gallery img:hover {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.asset-img-thumb {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--border);
    cursor: pointer;
    background: #f1f5f9;
    transition: all 0.2s;
}

.asset-img-thumb:hover {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.more-badge {
    background: var(--accent-glow);
    color: var(--accent);
    font-size: 0.7rem;
    font-weight: 700;
    padding: 6px 10px;
    border-radius: 8px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.more-badge:hover {
    background: var(--accent);
    color: white;
}

.count-badge {
    background: var(--accent-glow);
    color: var(--accent);
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.9rem;
}

/* Filter Panel */
.filter-panel {
    display: flex;
    gap: 1rem;
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    align-items: flex-end;
}

.filter-group {
    flex: 1;
    min-width: 150px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-group label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-weight: 600;
}

.filter-group input,
.filter-group select {
    padding: 0.6rem 0.8rem;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.9rem;
    cursor: pointer;
}

.filter-group input:focus,
.filter-group select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.filter-group select option {
    background: #ffffff;
    color: var(--text-primary);
}

/* Modal */
#image-modal {
    flex-direction: column;
    padding: 2rem;
}

.modal-close {
    position: absolute;
    top: 2rem;
    right: 3rem;
    font-size: 3rem;
    color: white;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.modal-close:hover {
    opacity: 1;
}

#modal-img {
    max-width: 90%;
    max-height: 85vh;
    border-radius: 12px;
    box-shadow: 0 0 50px rgba(0,0,0,0.8);
    object-fit: contain;
}

.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    margin-top: 2rem;
    margin-bottom: 2rem;
}

#page-info {
    font-size: 0.9rem;
    color: var(--text-secondary);
    min-width: 100px;
    text-align: center;
}

/* Hide scrollbar for Chrome/Safari */
.view::-webkit-scrollbar {
    width: 6px;
}
.view::-webkit-scrollbar-track {
    background: transparent;
}
.view::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}
/* Gallery Modal Styles */
.gallery-modal-card {
    background: white;
    width: 80%;
    max-width: 1200px;
    min-height: 400px;
    max-height: 85vh;
    border-radius: 24px;
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.15);
}

.gallery-modal-header {
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
}

.gallery-modal-close {
    font-size: 2rem;
    cursor: pointer;
    color: var(--text-secondary);
}

.gallery-modal-grid {
    padding: 2rem;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1.5rem;
    flex: 1;
}

.gallery-modal-grid img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: transform 0.2s;
}

.gallery-modal-grid img:hover {
    transform: scale(1.03);
}
