/* Je4nDev MC v5 — Base (Premium Edition) */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

body {
    font-family: var(--font-body);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: var(--leading-normal);
    overflow: hidden;
    height: 100vh;
    position: relative;
}

/* Noise texture overlay */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: var(--bg-noise);
    opacity: 0.02;
    pointer-events: none;
    z-index: 0;
}

a { color: var(--brand-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

::selection { background: rgba(14, 165, 233, 0.3); color: #fff; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-default); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--border-active); }

/* App Layout */
#app-layout {
    display: flex;
    height: 100vh;
    overflow: hidden;
    position: relative;
    z-index: 1;
}

#sidebar {
    flex-shrink: 0;
    width: var(--sidebar-width);
    transition: width var(--transition-normal);
}

#sidebar.collapsed { width: var(--sidebar-collapsed); }

#content {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-8) var(--space-10);
    padding-bottom: var(--space-20);
    max-width: 1440px;
    width: 100%;
    animation: var(--page-enter);
}

/* Page transition */
.content-exit {
    animation: var(--page-exit);
}

/* Topbar */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4) 0;
    margin-bottom: var(--space-6);
    border-bottom: 1px solid var(--border-subtle);
}
.topbar-breadcrumb {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-sm);
    color: var(--text-muted);
}
.topbar-breadcrumb span { color: var(--text-secondary); }
.topbar-breadcrumb .active { color: var(--text-primary); font-weight: var(--font-medium); }
.topbar-actions {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

/* Grid */
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-4); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-4); }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-6); }
.grid-auto {
    display: grid;
    gap: var(--space-4);
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

/* Section header */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.section-header h1 {
    font-family: var(--font-display);
    font-size: var(--text-2xl);
    font-weight: var(--font-bold);
    letter-spacing: -0.02em;
}
.section-subtitle {
    font-size: var(--text-sm);
    color: var(--text-muted);
}

/* Utility classes */
/* Margins */
.mb-1 { margin-bottom: var(--space-1); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }
.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }
.ml-2 { margin-left: var(--space-2); }
.mr-2 { margin-right: var(--space-2); }
.mx-auto { margin-left: auto; margin-right: auto; }

/* Flex utilities */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.justify-start { justify-content: flex-start; }
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }

/* Grid */
.grid { display: grid; }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-1 { grid-template-columns: 1fr; }

/* Text */
.text-xs { font-size: var(--text-xs); }
.text-sm { font-size: var(--text-sm); }
.text-base { font-size: var(--text-base); }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-brand { color: var(--brand-primary); }
.text-success { color: var(--color-success); }
.text-error { color: var(--color-error); }
.text-warning { color: var(--color-warning); }
.text-center { text-align: center; }
.fw-medium { font-weight: var(--font-medium); }
.fw-semibold { font-weight: var(--font-semibold); }
.fw-bold { font-weight: var(--font-bold); }
.font-mono { font-family: var(--font-mono); }

/* Width */
.w-full { width: 100%; }
.min-w-0 { min-width: 0; }

/* Display */
.inline-flex { display: inline-flex; }
.hidden { display: none; }

/* Padding */
.p-2 { padding: var(--space-2); }
.p-3 { padding: var(--space-3); }
.p-4 { padding: var(--space-4); }
.px-3 { padding-left: var(--space-3); padding-right: var(--space-3); }
.py-2 { padding-top: var(--space-2); padding-bottom: var(--space-2); }

/* Overflow */
.overflow-hidden { overflow: hidden; }
.overflow-ellipsis { text-overflow: ellipsis; white-space: nowrap; overflow: hidden; }

/* Misc */
.leading-snug { line-height: 1.35; }

/* Responsive */
@media (max-width: 1280px) {
    .grid-4 { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 1024px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    #content { padding: var(--space-6); }
}
@media (max-width: 640px) {
    .grid-4, .grid-3, .grid-2, .grid-auto { grid-template-columns: 1fr; }
    #content { padding: var(--space-4); }
}