* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; width: 100%; overflow-x: hidden; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; background: #121212; color: #e0e0e0; min-height: 100vh; display: flex; flex-direction: column; }
#app { flex: 1; display: flex; flex-direction: column; }
.screen { display: none; flex: 1; }
.screen.active { display: flex; flex-direction: column; }

.login-container { min-height: 100vh; width: 100%; display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 20px; background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%); text-align: center; }
.logo { font-size: 80px; margin-bottom: 10px; }
.login-container h1 { color: #fff; font-size: 28px; margin-bottom: 5px; }
.subtitle { color: #888; margin-bottom: 30px; font-size: 14px; }
#login-form, #register-form { display: flex; flex-direction: column; align-items: center; width: 100%; }
input, select, textarea { width: 100%; max-width: 340px; padding: 14px; margin: 6px 0; background: #1e1e1e; border: 1px solid #333; border-radius: 8px; color: #fff; font-size: 16px; text-align: left; font-family: inherit; }
input:focus, select:focus, textarea:focus { outline: none; border-color: #4a9eff; }
textarea { resize: vertical; min-height: 120px; }
.btn-primary { width: 100%; max-width: 340px; padding: 14px; margin: 8px 0; background: #4a9eff; color: #fff; border: none; border-radius: 8px; font-size: 16px; font-weight: 600; cursor: pointer; }
.btn-primary:active { background: #3a8eef; }
.btn-secondary { width: 100%; max-width: 340px; padding: 14px; margin: 8px 0; background: transparent; color: #4a9eff; border: 1px solid #4a9eff; border-radius: 8px; font-size: 16px; cursor: pointer; }
.checkbox-label { display: flex; align-items: center; justify-content: center; max-width: 340px; margin: 10px 0; color: #ccc; font-size: 14px; }
.checkbox-label input { width: auto; margin-right: 10px; }
.message { max-width: 340px; margin-top: 15px; padding: 10px; border-radius: 6px; text-align: center; font-size: 14px; }
.message.error { background: #3a1a1a; color: #ff6b6b; }
.message.success { background: #1a3a1a; color: #6bff6b; }

#main-screen { display: none; flex-direction: column; min-height: 100vh; }
#main-screen.active { display: flex; }
header { background: #1a1a2e; padding: 15px 20px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #2a2a2a; }
.header-title { color: #fff; font-weight: 600; font-size: 18px; }
.btn-logout { background: transparent; color: #ff6b6b; border: 1px solid #ff6b6b; padding: 6px 12px; border-radius: 6px; font-size: 13px; cursor: pointer; }
.user-info { background: #1e1e2e; padding: 12px 20px; font-size: 14px; color: #aaa; border-bottom: 1px solid #2a2a2a; }
.tab-content { display: none; padding: 20px; padding-bottom: 100px; }
.tab-content.active { display: block; }
h2 { color: #fff; margin-bottom: 15px; font-size: 20px; }
h3 { color: #fff; margin-bottom: 10px; font-size: 16px; }
.card { background: #1e1e1e; border: 1px solid #2a2a2a; border-radius: 10px; padding: 18px; margin-bottom: 15px; }
.card label { display: block; color: #aaa; font-size: 13px; margin-top: 10px; margin-bottom: 4px; }
.card.result { background: #0d2818; border-color: #1a5d3a; }
.card.summary { background: #1a2332; border-color: #2a4a6a; }
.result h3 { color: #6bff6b; font-size: 32px; margin-bottom: 10px; }
.result .breakdown { margin-top: 15px; font-size: 13px; color: #aaa; line-height: 1.8; }

.bottom-nav { position: fixed; bottom: 0; left: 0; right: 0; background: #1a1a1a; border-top: 1px solid #2a2a2a; display: flex; justify-content: space-around; padding: 8px 0; z-index: 100; }
.nav-btn { background: transparent; border: none; color: #888; display: flex; flex-direction: column; align-items: center; padding: 6px 10px; cursor: pointer; font-size: 11px; flex: 1; }
.nav-btn.active { color: #4a9eff; }
.nav-icon { font-size: 22px; margin-bottom: 2px; }

.bbcode-editor { background: #1a1a1a; border: 1px solid #333; border-radius: 8px; margin: 10px 0; overflow: hidden; }
.bbcode-toolbar { display: flex; flex-wrap: wrap; gap: 2px; padding: 8px; background: #0d0d1a; border-bottom: 1px solid #333; }
.bbcode-btn { background: #2a2a3a; color: #fff; border: 1px solid #3a3a4a; border-radius: 4px; padding: 6px 10px; font-size: 13px; cursor: pointer; min-width: 32px; font-weight: 600; }
.bbcode-btn:active { background: #4a9eff; }
.bbcode-btn.help { background: #4a9eff; }
.bbcode-textarea { width: 100%; min-height: 150px; padding: 12px; background: #1e1e1e; border: none; color: #fff; font-family: monospace; font-size: 14px; resize: vertical; }
.bbcode-textarea:focus { outline: none; }
.bbcode-preview-toggle { display: flex; border-bottom: 1px solid #333; }
.bbcode-preview-toggle button { flex: 1; padding: 8px; background: #1a1a2e; color: #888; border: none; cursor: pointer; font-size: 13px; }
.bbcode-preview-toggle button.active { background: #2a2a3a; color: #4a9eff; }
.bbcode-preview { padding: 12px; min-height: 150px; color: #ddd; font-size: 14px; line-height: 1.6; word-wrap: break-word; }
.bbcode-preview img { max-width: 100%; border-radius: 8px; margin: 10px 0; }
.bbcode-preview a { color: #4a9eff; }

.forum-category { background: #1e1e1e; border: 1px solid #2a2a2a; border-radius: 10px; padding: 15px; margin-bottom: 12px; cursor: pointer; display: flex; align-items: center; gap: 15px; }
.forum-category:active { background: #252525; }
.forum-category-icon { font-size: 36px; flex-shrink: 0; }
.forum-category-info { flex: 1; }
.forum-category-name { color: #4a9eff; font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.forum-category-desc { color: #888; font-size: 13px; line-height: 1.4; }

.forum-header { display: flex; align-items: center; gap: 10px; margin-bottom: 15px; flex-wrap: wrap; }
.forum-header h2 { margin: 0; flex: 1; }
.btn-back { background: transparent; color: #4a9eff; border: 1px solid #4a9eff; padding: 8px 12px; border-radius: 6px; font-size: 13px; cursor: pointer; }

.topic-item { background: #1e1e1e; border: 1px solid #2a2a2a; border-radius: 8px; padding: 12px 15px; margin-bottom: 8px; cursor: pointer; display: flex; align-items: center; gap: 12px; }
.topic-item:active { background: #252525; }
.topic-icon { font-size: 24px; flex-shrink: 0; }
.topic-info { flex: 1; min-width: 0; }
.topic-title { color: #fff; font-size: 15px; font-weight: 500; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topic-meta { color: #888; font-size: 12px; }
.topic-stats { text-align: right; color: #666; font-size: 12px; flex-shrink: 0; }
.topic-stats div { margin-bottom: 2px; }

.post-item { background: #1e1e1e; border: 1px solid #2a2a2a; border-radius: 10px; padding: 15px; margin-bottom: 12px; }
.post-header { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px solid #2a2a2a; }
.post-avatar { width: 40px; height: 40px; border-radius: 50%; background: #4a9eff; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 600; font-size: 16px; flex-shrink: 0; }
.post-author-info { flex: 1; }
.post-author { color: #4a9eff; font-weight: 600; font-size: 14px; }
.post-date { color: #888; font-size: 12px; }
.post-content { color: #ddd; font-size: 14px; line-height: 1.6; word-wrap: break-word; }
.post-content img { max-width: 100%; border-radius: 8px; margin: 10px 0; cursor: pointer; }
.post-content a { color: #4a9eff; text-decoration: underline; }
.post-content blockquote { border-left: 4px solid #4a9eff; padding: 10px 15px; margin: 10px 0; background: #1a1a2e; border-radius: 0 8px 8px 0; color: #ccc; font-style: italic; }
.post-content pre { background: #0d0d1a; padding: 15px; border-radius: 8px; overflow-x: auto; border: 1px solid #2a2a2a; font-family: monospace; font-size: 13px; }
.post-actions { display: flex; gap: 15px; margin-top: 12px; padding-top: 10px; border-top: 1px solid #2a2a2a; }
.post-action { background: transparent; border: none; color: #888; font-size: 13px; cursor: pointer; display: flex; align-items: center; gap: 5px; padding: 4px 8px; border-radius: 4px; }
.post-action:active { background: #2a2a3a; }
.post-action.liked { color: #ff6b6b; }

.reply-form { background: #1e1e1e; border: 1px solid #2a2a2a; border-radius: 10px; padding: 15px; margin-top: 20px; }
.reply-form h3 { margin-bottom: 10px; }

.history-item { background: #1e1e1e; border: 1px solid #2a2a2a; border-radius: 8px; padding: 12px; margin-bottom: 8px; display: flex; justify-content: space-between; align-items: center; }
.history-item .date { color: #aaa; font-size: 13px; }
.history-item .hours { color: #fff; font-size: 14px; }
.history-item .pay { color: #6bff6b; font-weight: 600; }
.month-selector { display: flex; gap: 10px; margin-bottom: 15px; }
.month-selector input { flex: 1; margin: 0; }
.month-selector button { width: auto; margin: 0; padding: 14px 20px; }
.summary h3 { color: #4a9eff; font-size: 24px; }
.summary .stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.summary .stat { background: #1a1a2e; padding: 10px; border-radius: 6px; }
.summary .stat-label { color: #888; font-size: 12px; }
.summary .stat-value { color: #fff; font-size: 18px; font-weight: 600; margin-top: 3px; }
.loading { text-align: center; padding: 20px; color: #888; }

.modal { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.8); display: flex; align-items: center; justify-content: center; z-index: 1000; padding: 20px; }
.modal-content { background: #1e1e1e; border: 1px solid #2a2a2a; border-radius: 12px; max-width: 500px; width: 100%; max-height: 80vh; overflow-y: auto; }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 15px; border-bottom: 1px solid #2a2a2a; }
.modal-header h3 { margin: 0; }
.modal-close { background: transparent; border: none; color: #fff; font-size: 28px; cursor: pointer; line-height: 1; }
.smilies-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; padding: 15px; }
.smiley-btn { background: #2a2a3a; border: none; font-size: 28px; padding: 10px; border-radius: 8px; cursor: pointer; }
.smiley-btn:active { background: #4a9eff; }
.bbcode-help-content { padding: 15px; font-size: 14px; line-height: 1.8; }
.bbcode-help-content p { margin-bottom: 8px; }
.bbcode-help-content hr { margin: 15px 0; border: none; border-top: 1px solid #2a2a2a; }

.install-banner { position: fixed; top: 0; left: 0; right: 0; background: linear-gradient(135deg, #4a9eff 0%, #3a8eef 100%); color: #fff; padding: 12px 15px; z-index: 1000; box-shadow: 0 2px 10px rgba(0,0,0,0.3); }
.install-banner-content { display: flex; align-items: center; gap: 10px; max-width: 800px; margin: 0 auto; }
.install-banner-content span { flex: 1; font-size: 14px; font-weight: 500; }
.btn-install { background: #fff; color: #4a9eff; border: none; padding: 8px 16px; border-radius: 6px; font-weight: 600; cursor: pointer; font-size: 13px; }
.btn-dismiss { background: transparent; color: #fff; border: none; font-size: 24px; cursor: pointer; padding: 0 5px; line-height: 1; }

@media (min-width: 768px) { .tab-content { max-width: 800px; margin: 0 auto; } }