:root {
    --primary: #1a1a1a;
    --primary-hover: #333333;
    --secondary: #666666;
    --accent: #0a0a0a;
    --bg: #fafafa;
    --bg-secondary: #f5f5f5;
    --surface: #ffffff;
    --text: #1a1a1a;
    --text-light: #777777;
    --text-lighter: #aaaaaa;
    --border: #e5e5e5;
    --border-light: #f0f0f0;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04);
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.08);
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--bg);
    background-image: 
        url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%231a1a1a' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    min-height: 100vh;
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.6;
}

/* ============ NAVBAR ============ */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 0.7rem 2rem;
    background: rgba(255, 255, 255, 0.95);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.5px;
}

.sidebar-toggle {
    background: none;
    border: 1px solid var(--border);
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 1rem;
    color: var(--text);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-toggle:hover {
    background: var(--bg-secondary);
    border-color: var(--primary);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.35rem 0.75rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-light);
    font-size: 0.85rem;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    list-style: none;
}

.nav-link {
    text-decoration: none;
    color: var(--text);
    font-weight: 500;
    font-size: 0.85rem;
    padding: 0.45rem 0.9rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.nav-link:hover {
    background: var(--bg-secondary);
}

/* ============ SIDEBAR ============ */
.sidebar {
    position: fixed;
    left: -280px;
    top: 0;
    bottom: 0;
    width: 260px;
    z-index: 999;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--surface);
    border-right: 1px solid var(--border);
    padding: 1rem 0;
    overflow-y: auto;
}

.sidebar.active {
    left: 0;
}

.sidebar-header {
    padding: 1.5rem 1.25rem 1rem;
    text-align: center;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 0.5rem;
}

.sidebar-header h2 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.3px;
}

.sidebar-header .subtitle {
    font-size: 0.75rem;
    color: var(--text-light);
    margin-top: 0.15rem;
}

.sidebar-nav {
    padding: 0.75rem;
}

.nav-section {
    margin-bottom: 1rem;
}

.nav-section h3 {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-light);
    margin-bottom: 0.4rem;
    padding-left: 0.6rem;
    font-weight: 600;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.55rem 0.65rem;
    color: var(--text);
    text-decoration: none;
    border-radius: var(--radius-sm);
    margin-bottom: 1px;
    transition: var(--transition);
    font-weight: 400;
    font-size: 0.85rem;
}

.nav-item:hover {
    background: var(--bg-secondary);
}

.nav-item.active {
    background: var(--primary);
    color: white;
    font-weight: 500;
}

.nav-item i {
    width: 18px;
    text-align: center;
    font-size: 0.85rem;
}

/* ============ OVERLAY ============ */
.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 998;
}

.overlay.active {
    display: block;
}

/* ============ MAIN CONTENT ============ */
.main-content {
    margin-top: 60px;
    padding: 2rem;
    transition: margin-left 0.3s ease;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.main-content.sidebar-open {
    margin-left: calc(260px + 2rem);
}

/* ============ CARDS ============ */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    margin-bottom: 1.25rem;
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.card:hover {
    box-shadow: var(--shadow);
    border-color: #d4d4d4;
}

.card:hover::before {
    opacity: 0.3;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.card-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.3px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-title::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 18px;
    background: var(--primary);
    border-radius: 2px;
}

.card-subtitle {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-top: 0.2rem;
}

/* ============ GRID ============ */
.grid {
    display: grid;
    gap: 1.25rem;
}
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* ============ TABLES ============ */
.table-container {
    overflow-x: auto;
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
}

thead {
    background: var(--bg-secondary);
}

th {
    padding: 0.8rem 0.9rem;
    text-align: left;
    font-weight: 600;
    color: var(--text);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    white-space: nowrap;
    border-bottom: 2px solid var(--border);
}

td {
    padding: 0.8rem 0.9rem;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
    font-size: 0.85rem;
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--bg); }

/* ============ BUTTONS ============ */
.btn {
    padding: 0.55rem 1.1rem;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.82rem;
    font-family: inherit;
    letter-spacing: -0.2px;
}

.btn-primary {
    background: var(--primary);
    color: white;
    border: 1px solid var(--primary);
}
.btn-primary:hover { background: var(--primary-hover); }

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--border);
}
.btn-outline:hover { background: var(--bg-secondary); border-color: var(--primary); }

.btn-danger {
    background: transparent;
    color: #dc2626;
    border: 1px solid #fecaca;
}
.btn-danger:hover { background: #fef2f2; }

.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.78rem; }
.btn-lg { padding: 0.8rem 1.6rem; font-size: 0.95rem; }

/* ============ FORMS ============ */
.form-group { margin-bottom: 1.2rem; }

.form-label {
    display: block;
    margin-bottom: 0.35rem;
    font-weight: 600;
    color: var(--text);
    font-size: 0.8rem;
    letter-spacing: -0.2px;
}

.form-control {
    width: 100%;
    padding: 0.65rem 0.85rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    transition: var(--transition);
    color: var(--text);
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
}

.form-control::placeholder { color: var(--text-lighter); }

select.form-control {
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M6 8L1 3h10z' fill='%23888'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 2rem;
}

textarea.form-control { resize: vertical; min-height: 80px; }

/* ============ BADGES ============ */
.badge {
    padding: 0.18rem 0.6rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 500;
    white-space: nowrap;
}
.badge-primary { background: var(--bg-secondary); color: var(--primary); }
.badge-success { background: #ecfdf5; color: #059669; }
.badge-warning { background: #fffbeb; color: #d97706; }
.badge-danger  { background: #fef2f2; color: #dc2626; }
.badge-info    { background: #eff6ff; color: #2563eb; }

/* ============ ALERTS ============ */
.alert {
    padding: 0.8rem 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    font-size: 0.85rem;
    border: 1px solid;
}
.alert-success { background: #ecfdf5; color: #065f46; border-color: #a7f3d0; }
.alert-error   { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
.alert-info    { background: #eff6ff; color: #1e40af; border-color: #bfdbfe; }

/* ============ EMPTY STATE ============ */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-light);
}
.empty-state i { font-size: 3rem; display: block; margin-bottom: 1rem; opacity: 0.2; color: var(--text); }
.empty-state p { font-size: 0.95rem; font-weight: 500; color: var(--text); }
.empty-state span { font-size: 0.8rem; color: var(--text-light); display: block; margin-top: 0.25rem; }

/* ============ STAT CARD ============ */
.stat-card { display: flex; align-items: center; gap: 1rem; }

.stat-icon {
    font-size: 1.8rem;
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    background: var(--bg-secondary);
    flex-shrink: 0;
    border: 1px solid var(--border-light);
    position: relative;
    overflow: hidden;
}

.stat-icon::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary);
    opacity: 0.3;
}

.stat-value { font-size: 1.6rem; font-weight: 700; letter-spacing: -1px; }
.stat-label { color: var(--text-light); font-size: 0.78rem; font-weight: 500; }

/* ============ GALLERY ============ */
.gallery-item {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    transition: var(--transition);
}

.gallery-item:hover { box-shadow: var(--shadow-lg); }

.gallery-item img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    transition: transform 0.4s ease;
    display: block;
}

.gallery-item:hover img { transform: scale(1.03); }

.gallery-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    padding: 1.25rem 1rem 0.75rem;
    color: white;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.gallery-item:hover .gallery-overlay { opacity: 1; }
.gallery-overlay p { font-size: 0.8rem; font-weight: 500; }

/* ============ WELCOME CARD ============ */
.welcome-card { display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; }

.welcome-icon {
    font-size: 2.5rem;
    width: 65px;
    height: 65px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-lg);
    background: var(--bg-secondary);
    flex-shrink: 0;
    border: 1px solid var(--border-light);
}

.welcome-text h2 { font-size: 1.3rem; font-weight: 700; letter-spacing: -0.5px; }
.welcome-text p { color: var(--text-light); font-size: 0.85rem; margin-top: 0.2rem; }

/* ============ FOOTER ============ */
.footer {
    text-align: center;
    padding: 2rem;
    margin: 2rem auto 0;
    max-width: 1200px;
    border-top: 1px solid var(--border-light);
    position: relative;
}

.footer::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 1px;
    background: var(--primary);
}

.footer p { color: var(--text); font-weight: 500; font-size: 0.85rem; }
.footer small { color: var(--text-light); font-size: 0.75rem; display: block; margin-top: 0.2rem; }

/* ============ LIGHTBOX ============ */
.lightbox {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.92);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}
.lightbox.active { display: flex; }
.lightbox img { max-width: 90%; max-height: 80vh; border-radius: var(--radius); }
.lightbox-close {
    position: absolute;
    top: 20px; right: 30px;
    color: white; font-size: 2rem; cursor: pointer;
    width: 45px; height: 45px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%; transition: var(--transition);
}
.lightbox-close:hover { background: rgba(255,255,255,0.1); }
.lightbox-caption { color: white; text-align: center; margin-top: 1rem; font-size: 0.9rem; }

/* ============ AUTH ============ */
.auth-container { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 2rem; }
.auth-card { width: 100%; max-width: 400px; padding: 2.5rem; }
.auth-header { text-align: center; margin-bottom: 2rem; }
.auth-header h2 { font-size: 1.3rem; font-weight: 700; letter-spacing: -0.5px; }
.auth-header p { color: var(--text-light); font-size: 0.82rem; margin-top: 0.2rem; }

/* ============ ANIMATIONS ============ */
@keyframes slideIn {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}
.animate-in { animation: slideIn 0.4s ease-out; }

/* ============ RESPONSIVE ============ */
@media (max-width: 1024px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .main-content { padding: 1rem; margin-top: 55px; }
    .main-content.sidebar-open { margin-left: 0; }
    .navbar { padding: 0.55rem 1rem; }
    .nav-menu { display: none; }
    .sidebar-toggle { display: flex; }
    .card-header { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 480px) {
    .nav-user span { display: none; }
    .stat-card { flex-direction: column; text-align: center; }
    .welcome-card { flex-direction: column; text-align: center; }
}