* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, sans-serif; background: #0e1217; color: #e6e6e6; }
.nav { display: flex; gap: 0; align-items: stretch; padding: 0 1rem; background: #1a1f29; border-bottom: 1px solid #2a3142; height: 42px; }
.nav .brand { font-weight: 700; letter-spacing: 0.2em; color: #6ee7b7; padding: 0 1rem 0 0.5rem; display: flex; align-items: center; margin-right: 0.25rem; }
.nav a { color: #cbd5e1; text-decoration: none; }
.nav a:hover { color: #fff; }

/* ── Nav items ─────────────────────────────────────────────────────────────── */
.nav-item {
    position: relative;
    display: flex;
    align-items: center;
}
.nav-link {
    color: #cbd5e1;
    text-decoration: none;
    font-size: 0.82rem;
    padding: 0 0.7rem;
    height: 42px;
    display: flex;
    align-items: center;
    white-space: nowrap;
    cursor: pointer;
    border: 0;
    background: none;
    letter-spacing: .01em;
    transition: color .15s, background .15s;
}
.nav-link:hover, .nav-item:focus-within .nav-link {
    color: #f8fafc;
    background: #243044;
}

/* ── Dropdown ──────────────────────────────────────────────────────────────── */
.nav-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 170px;
    background: #1a1f29;
    border: 1px solid #2a3142;
    border-top: 2px solid #3b82f6;
    border-radius: 0 0 6px 6px;
    box-shadow: 0 8px 24px rgba(0,0,0,.55);
    z-index: 1000;
    padding: 4px 0;
}
.nav-item:hover .nav-dropdown,
.nav-item:focus-within .nav-dropdown {
    display: block;
}
.nav-dropdown a {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 7px 14px;
    color: #cbd5e1;
    text-decoration: none;
    font-size: 0.82rem;
    white-space: nowrap;
    transition: background .12s, color .12s;
}
.nav-dropdown a:hover { background: #243044; color: #f8fafc; }
.nav-dropdown hr { border: 0; border-top: 1px solid #2a3142; margin: 3px 0; }
main { padding: 1.5rem; }
.hero h1 { margin-top: 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1rem; }
.panel { background: #161b25; border: 1px solid #2a3142; border-radius: 8px; padding: 1rem; }
.panel h2 { margin-top: 0; font-size: 1rem; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.1em; }
ul { padding-left: 1.2rem; }
code { background: #1a1f29; padding: 0.1rem 0.4rem; border-radius: 4px; }
.spacer { flex: 1; }
.nav-user { display: flex; align-items: center; color: #94a3b8; font-size: 0.85rem; white-space: nowrap; }
#nav-auth { display: flex; align-items: center; font-size: 0.85rem; white-space: nowrap; margin-left: 12px; }
.auth { max-width: 420px; margin: 2rem auto; }
.auth form { display: flex; flex-direction: column; gap: 0.6rem; margin-bottom: 1.5rem; padding: 1rem; background: #161b25; border: 1px solid #2a3142; border-radius: 8px; }
.auth label { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.85rem; color: #94a3b8; }
.auth input, .auth select { padding: 0.5rem; background: #0e1217; color: #e6e6e6; border: 1px solid #2a3142; border-radius: 4px; font: inherit; }
.auth button { padding: 0.6rem; background: #6ee7b7; color: #0e1217; border: 0; border-radius: 4px; font-weight: 600; cursor: pointer; }
.auth button:hover { background: #34d399; }
.auth-msg { color: #fbbf24; min-height: 1.2em; }

/* ── Toast notifications ──────────────────────────────────────────────────── */
/* Right column — fire missions, tactical alerts, streams, system broadcasts.
   Auto-dismiss in 5 s. */
#arrow-toast-container {
    position: fixed; bottom: 1.5rem; right: 1.5rem;
    display: flex; flex-direction: column; gap: 0.5rem;
    z-index: 9999; width: 320px; pointer-events: none;
}
/* Chat toasts (DIRECT / GROUP) — same right-side column, stacked above the
   system column. Blue accent so they're distinguishable. Auto-dismiss 10 min. */
#arrow-chat-toast-container {
    position: fixed; top: 4rem; right: 1.5rem;
    display: flex; flex-direction: column; gap: 0.5rem;
    z-index: 9999; width: 320px; pointer-events: none;
    max-height: calc(100vh - 6rem); overflow-y: auto;
}
#arrow-chat-toast-container .arrow-toast { border-left-color: #38bdf8; }
#arrow-chat-toast-container .arrow-toast-from a { color: #38bdf8; }
#arrow-chat-toast-container .arrow-toast-from a:hover { color: #7dd3fc; }
#arrow-chat-toast-container .arrow-toast-send { background: #38bdf8; }
#arrow-chat-toast-container .arrow-toast-send:hover { background: #7dd3fc; }
.arrow-toast {
    background: #1e2736; border: 1px solid #2a3142;
    border-left: 3px solid #34d399; border-radius: 8px;
    padding: 0.75rem; box-shadow: 0 4px 20px rgba(0,0,0,0.55);
    pointer-events: all; animation: toastIn 0.2s ease;
}
@keyframes toastIn {
    from { opacity: 0; transform: translateX(20px); }
    to   { opacity: 1; transform: translateX(0); }
}
.arrow-toast-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 0.35rem;
}
.arrow-toast-from a { color: #34d399; font-weight: 600; text-decoration: none; font-size: 0.85rem; }
.arrow-toast-from a:hover { color: #6ee7b7; }
.arrow-toast-from em { color: #94a3b8; font-style: normal; font-size: 0.75rem; margin-left: 0.3rem; }
.arrow-toast-close {
    background: none; border: none; color: #64748b;
    cursor: pointer; font-size: 0.8rem; padding: 0 0.2rem; line-height: 1;
}
.arrow-toast-close:hover { color: #e2e8f0; }
.arrow-toast-body {
    color: #cbd5e1; font-size: 0.85rem; line-height: 1.4;
    margin-bottom: 0.5rem; word-break: break-word;
}
.arrow-toast-reply { display: flex; gap: 0.4rem; }
.arrow-toast-input {
    flex: 1; min-width: 0;
    background: #0e1217; color: #e6e6e6;
    border: 1px solid #2a3142; border-radius: 4px;
    padding: 0.3rem 0.5rem; font: inherit; font-size: 0.82rem;
}
.arrow-toast-input:focus { outline: none; border-color: #34d399; }
.arrow-toast-send {
    background: #34d399; color: #0e1217; border: none;
    border-radius: 4px; padding: 0.3rem 0.65rem;
    font-weight: 600; font-size: 0.82rem; cursor: pointer; white-space: nowrap;
}
.arrow-toast-send:hover { background: #6ee7b7; }
