:root {
    --background: #f0f2f5;
    --surface: #ffffff;
    --surface-2: #f8fafc;
    --surface-hover: #f1f5f9;
    --text: #0f172a;
    --muted: #64748b;
    --border: #e2e8f0;
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary: #7c3aed;
    --secondary-hover: #6d28d9;
    --success: #10b981;
    --success-hover: #059669;
    --danger: #ef4444;
    --danger-hover: #dc2626;
    --button-text: #ffffff;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --radius: 6px;
    --space: 16px;
    --nav-height: 56px;
    --font-main: "Inter", system-ui, sans-serif;
    --font-retro: "VT323", monospace;
}

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&family=VT323&display=swap');

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--background);
    color: var(--text);
    font-family: var(--font-main);
    font-size: 14px;
    line-height: 1.5;
}

a {
    color: inherit;
    text-decoration: none;
}

h1, h2, h3, p {
    margin: 0 0 12px 0;
}

/* Layout */
.container, .page-shell {
    max-width: 1000px;
    margin: 0 auto;
    padding: var(--space);
}

.col {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Navbar */
.navbar-container {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    height: var(--nav-height);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar {
    max-width: 1000px;
    margin: 0 auto;
    height: 100%;
    display: flex;
    align-items: center;
    padding: 0 var(--space);
    gap: 20px;
}

.nav-brand a {
    display: flex;
    flex-direction: column;
    line-height: 1;
}

.logo-text {
    font-weight: 800;
    font-size: 1.2rem;
    letter-spacing: -0.5px;
    color: var(--primary);
    animation: logo-pulse 3s ease-in-out infinite;
}

@keyframes logo-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.02); }
}

.logo-sub {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--muted);
    align-self: flex-end;
}

.nav-links {
    display: flex;
    gap: 4px;
}

.navbut {
    padding: 6px 10px;
    border-radius: var(--radius);
    font-weight: 600;
    color: var(--muted);
    transition: all 0.2s;
}

.navbut:hover {
    background: var(--surface-hover);
    color: var(--text);
}

.header-search {
    flex: 1;
    display: flex;
    max-width: 400px;
    position: relative;
}

.header-search input {
    width: 100%;
    padding: 6px 36px 6px 12px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 0.9rem;
}

.search-icon {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    opacity: 0.5;
}

.nav-actions {
    display: flex;
    gap: 8px;
}

/* Panels */
.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--space);
    box-shadow: var(--shadow);
}

.panel h2 {
    font-size: 1.1rem;
    font-weight: 700;
}

/* File List */
.file-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-radius: var(--radius);
    transition: background 0.1s;
}

.file-item:hover {
    background: var(--surface-hover);
}

.filename-link {
    font-weight: 600;
    color: var(--primary);
}

.meta-tag {
    font-size: 0.75rem;
    color: var(--muted);
    background: var(--surface-2);
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 8px;
}

.rig {
    display: flex;
    gap: 4px;
}

.mini-but {
    padding: 4px 8px;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 4px;
    color: var(--button-text);
}

.but_upl, .but_act, .but_dwn, .but_del {
    cursor: pointer;
    border: none;
    transition: opacity 0.2s;
}

.but_upl { background: var(--success); }
.but_act { background: var(--primary); }
.but_dwn { background: var(--secondary); }
.but_del { background: var(--danger); }

.mini-but:hover {
    opacity: 0.9;
}

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin: 12px 0;
}

.stat-card {
    padding: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    position: relative;
}

.stat-card strong {
    display: block;
    font-size: 1.8rem;
    margin-top: 4px;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--muted);
    font-weight: 600;
}

.tooltip-trigger {
    cursor: help;
    border-bottom: 1px dotted var(--muted);
}

.metric-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}

.metric-row:last-child {
    border-bottom: none;
}

/* Responsive */
@media (max-width: 768px) {
    .navbar {
        gap: 10px;
    }
    .header-search {
        display: none;
    }
    .nav-brand .logo-text {
        font-size: 1rem;
    }
}
