/* ===== Base ===== */
* { box-sizing: border-box; }
html, body {
    margin: 0; padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: #0f1115; color: #e6e6e6;
    height: 100%; overflow: hidden;
}
a { color: #4dabf7; text-decoration: none; }

/* ===== Layout ===== */
.app-wrapper {
    display: flex; height: 100vh; width: 100vw;
}
.map-container {
    flex: 1 1 auto; position: relative; min-width: 0;
}
#map {
    width: 100%; height: 100%;
}
.sidebar {
    width: 360px; flex: 0 0 360px;
    display: flex; flex-direction: column;
    background: #161920;
    border-left: 1px solid #2b2f38;
}
@media (max-width: 900px) {
    .app-wrapper { flex-direction: column-reverse; }
    .map-container { flex: 1 1 auto; min-height: 40%; }
    .sidebar {
        width: 100%;
        flex: 0 0 auto;
        height: 40vh;
        min-height: 260px;
        max-height: 420px;
        border-left: none;
        border-bottom: 1px solid #2b2f38;
    }
    .chat-box { flex-direction: column-reverse; }
    .topbar { padding: 8px 10px; }
    .topbar h1 { font-size: 15px; }
    .topbar .user-info { font-size: 11px; }
    .hunter-panel { padding: 8px 10px; }
    .chat-messages { padding: 8px; }
    .chat-message { font-size: 13px; padding: 6px 8px; margin-bottom: 6px; }
    .chat-input-area { padding: 8px; }
    .chat-input-area input { padding: 8px 10px; }
    .btn { padding: 6px 10px; font-size: 13px; }
}

/* ===== Header ===== */
.topbar {
    padding: 12px 16px;
    border-bottom: 1px solid #2b2f38;
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.topbar h1 { font-size: 18px; margin: 0; }
.topbar .user-info { font-size: 13px; color: #adb5bd; }
.topbar .nav-links { display: flex; gap: 8px; }

/* ===== Chat ===== */
.chat-box {
    flex: 1 1 auto;
    display: flex; flex-direction: column;
    overflow: hidden;
}
.chat-messages {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 12px;
}
.chat-message {
    margin-bottom: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    background: #1f232c;
    font-size: 14px;
    line-height: 1.4;
}
.chat-message.system {
    background: transparent; color: #868e96; font-style: italic;
    padding: 4px 0;
}
.chat-message .meta {
    font-size: 12px; color: #adb5bd; margin-bottom: 2px;
}
.chat-message .author { font-weight: 600; color: #74c0fc; }
.chat-message.system .author { color: #ffa94d; }

.chat-input-area {
    padding: 12px; border-top: 1px solid #2b2f38;
    display: flex; gap: 8px;
}
.chat-input-area input {
    flex: 1 1 auto;
    background: #0f1115; color: #e6e6e6;
    border: 1px solid #2b2f38; border-radius: 6px; padding: 10px 12px; font-size: 14px;
}
.chat-input-area input:focus { outline: none; border-color: #4dabf7; }

.guest-hint {
    padding: 12px; text-align: center; color: #868e96; font-size: 13px;
    border-top: 1px solid #2b2f38;
}

/* ===== Hunter Panel ===== */
.hunter-panel {
    padding: 12px 16px;
    border-bottom: 1px solid #2b2f38;
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.hunter-panel .status-text { font-size: 14px; }
.hunter-panel .status-text.paused { color: #ff8787; font-weight: 600; }

/* ===== Buttons ===== */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 8px 14px; border-radius: 6px; border: none; cursor: pointer; font-size: 14px;
    background: #2b2f38; color: #e6e6e6; transition: background .15s ease;
}
.btn:hover { background: #343a40; }
.btn-primary { background: #1971c2; color: #fff; }
.btn-primary:hover { background: #1864ab; }
.btn-danger { background: #c92a2a; color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-warning { background: #f08c00; color: #fff; }
.btn-warning:hover { background: #e67700; }
.btn-success { background: #2f9e44; color: #fff; }
.btn-success:hover { background: #2b8a3e; }
.btn-sm { padding: 6px 10px; font-size: 12px; }

/* ===== Auth page ===== */
.auth-page {
    display: flex; align-items: center; justify-content: center;
    background: #0f1115;
}
.auth-box {
    width: 100%; max-width: 360px;
    background: #161920; padding: 28px; border-radius: 12px;
    border: 1px solid #2b2f38;
}
.auth-box h1 { margin-top: 0; font-size: 22px; }
.form-group { margin-bottom: 14px; }
.form-group label { display: block; margin-bottom: 6px; font-size: 13px; color: #adb5bd; }
.form-group input,
.form-group select {
    width: 100%; padding: 10px 12px; font-size: 14px;
    background: #0f1115; color: #e6e6e6; border: 1px solid #2b2f38; border-radius: 6px;
}
.form-group input:focus { outline: none; border-color: #4dabf7; }
.hint { font-size: 12px; color: #868e96; margin-top: 12px; }

/* ===== Admin tables ===== */
.container { max-width: 1200px; margin: 0 auto; padding: 20px; overflow: auto; height: 100vh; }
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.card {
    background: #161920; border: 1px solid #2b2f38; border-radius: 10px; padding: 18px; margin-bottom: 20px;
}
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th, .data-table td { padding: 10px; text-align: left; border-bottom: 1px solid #2b2f38; }
.data-table th { color: #adb5bd; font-weight: 500; }
.actions { white-space: nowrap; }
.badge { display: inline-block; padding: 3px 8px; border-radius: 12px; font-size: 12px; }
.badge-success { background: #2f9e44; color: #fff; }
.badge-warning { background: #f08c00; color: #fff; }
.badge-gray { background: #495057; color: #e6e6e6; }
.color-badge { display: inline-block; width: 18px; height: 18px; border-radius: 4px; border: 1px solid #495057; }
.alert { padding: 10px 14px; border-radius: 6px; margin-bottom: 14px; font-size: 14px; }
.alert.success { background: #2b8a3e22; color: #69db7c; border: 1px solid #2f9e44; }
.alert.error { background: #c92a2a22; color: #ff8787; border: 1px solid #c92a2a; }
.form-inline { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.form-inline .form-group { flex: 1 1 160px; margin-bottom: 0; }
code { background: #0f1115; padding: 2px 6px; border-radius: 4px; font-size: 12px; }
