* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: system-ui, sans-serif; background: #f5f6fa; color: #333; }

.hidden { display: none !important; }
.err { color: #e74c3c; font-size: 13px; margin-top: 6px; }

/* Login */
#view-login { display: flex; align-items: center; justify-content: center; height: 100vh; }
.login-box { background: #fff; padding: 40px; border-radius: 8px; box-shadow: 0 2px 12px rgba(0,0,0,.1); width: 320px; }
.login-box h2 { margin-bottom: 20px; text-align: center; }
.login-box input { display: block; width: 100%; padding: 10px; margin-bottom: 12px; border: 1px solid #ddd; border-radius: 4px; }
.login-box button { width: 100%; padding: 10px; background: #3498db; color: #fff; border: none; border-radius: 4px; cursor: pointer; }
.login-box button:hover { background: #2980b9; }

/* Nav */
nav { background: #2c3e50; color: #fff; padding: 0 20px; height: 48px; display: flex; align-items: center; gap: 12px; }
.nav-title { font-weight: bold; flex: 1; }
nav button { background: rgba(255,255,255,.15); color: #fff; border: none; padding: 6px 14px; border-radius: 4px; cursor: pointer; }
nav button:hover { background: rgba(255,255,255,.25); }
#nav-user { font-size: 13px; opacity: .8; }

/* Layout */
.content { display: flex; height: calc(100vh - 48px); }
.sidebar { width: 220px; background: #fff; border-right: 1px solid #e0e0e0; overflow-y: auto; flex-shrink: 0; }
.sidebar-header { display: flex; align-items: center; justify-content: space-between; padding: 12px; border-bottom: 1px solid #eee; font-weight: 600; font-size: 13px; }
.sidebar-header button { font-size: 12px; padding: 3px 8px; background: #3498db; color: #fff; border: none; border-radius: 3px; cursor: pointer; }
#portfolio-list, #admin-portfolio-list { list-style: none; }
#portfolio-list li, #admin-portfolio-list li { padding: 10px 12px; border-bottom: 1px solid #f0f0f0; cursor: pointer; font-size: 13px; }
#portfolio-list li:hover { background: #f0f7ff; }
#portfolio-list li.group-label { background: #f5f6fa; color: #999; font-size: 11px; font-weight: 600; cursor: default; padding: 6px 12px; letter-spacing: .5px; text-transform: uppercase; }
#portfolio-list li.group-label:hover { background: #f5f6fa; }
#portfolio-list li small, #admin-portfolio-list li small { color: #999; }

/* Main panel */
.main-panel { flex: 1; padding: 20px; overflow-y: auto; min-height: 0; }
#pos-chart { width: 100%; height: 200px; display: block; }
#chart-title { font-size: 16px; font-weight: 600; margin-bottom: 12px; }
#empty-hint { color: #aaa; margin-top: 60px; text-align: center; }

/* Admin */
.user-row { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid #f0f0f0; font-size: 13px; }
.tag { background: #eaf0fb; color: #3498db; padding: 2px 8px; border-radius: 10px; font-size: 11px; }
.user-row button { font-size: 12px; padding: 2px 8px; background: #e74c3c; color: #fff; border: none; border-radius: 3px; cursor: pointer; }
.create-user { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.create-user input, .create-user select { padding: 7px; border: 1px solid #ddd; border-radius: 4px; font-size: 13px; }
.create-user button { padding: 7px 16px; background: #27ae60; color: #fff; border: none; border-radius: 4px; cursor: pointer; }

/* Modal */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.4); display: flex; align-items: center; justify-content: center; }
.modal-box { background: #fff; padding: 28px; border-radius: 8px; width: 360px; }
.modal-box h3 { margin-bottom: 16px; }
.modal-box input { display: block; width: 100%; padding: 9px; margin-bottom: 10px; border: 1px solid #ddd; border-radius: 4px; }
.modal-btns { display: flex; gap: 8px; }
.modal-btns button { flex: 1; padding: 9px; border: none; border-radius: 4px; cursor: pointer; }
.modal-btns button:first-child { background: #3498db; color: #fff; }
.modal-btns button:last-child { background: #eee; }
