/* === Base === */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --bg: #141414;
    --surface: #1e1e1e;
    --surface-hover: #282828;
    --border: #333;
    --text: #c8c4b8;
    --text-muted: #787468;
    --accent: #5a8f6a;
    --accent-hover: #6aab7d;
    --danger: #8b4444;
    --danger-hover: #a85555;
    --warning: #9e8a4a;
    --online: #5a8f6a;
    --offline: #8b4444;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

/* === Navigation === */
header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

nav {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 1.5rem;
    height: 56px;
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-brand {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--accent);
    text-decoration: none;
    letter-spacing: -0.02em;
}

.nav-links {
    display: flex;
    gap: 0.25rem;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: color 0.15s, background 0.15s;
}

.nav-links a:hover { color: var(--text); background: var(--surface-hover); }
.nav-links a.active { color: var(--text); background: var(--surface-hover); }

.nav-user {
    margin-left: auto;
    font-size: 0.85rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logout {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.8rem;
}
.logout:hover { color: var(--danger); }

/* === Main Content === */
main {
    max-width: 960px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

h2 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    letter-spacing: -0.01em;
}

.count {
    font-weight: 400;
    color: var(--text-muted);
}

/* === Server Status === */
.status-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.5rem;
}

.status-grid {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.status-card {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    background: var(--bg);
    border: 1px solid var(--border);
}

.status-card.online .status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--online);
    box-shadow: 0 0 8px var(--online);
}

.status-card.offline .status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--offline);
    box-shadow: 0 0 8px var(--offline);
}

.status-label { font-size: 0.9rem; }

.status-card.players {
    gap: 0.5rem;
}

.player-count {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent);
}

.player-list {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.player-tag {
    background: var(--bg);
    border: 1px solid var(--border);
    padding: 0.3rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--text);
}

/* === Dashboard Grid === */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

/* === Preview Sections === */
.preview-section, .content-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.5rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.section-header h2 { margin-bottom: 0; }

.view-all {
    color: var(--accent);
    text-decoration: none;
    font-size: 0.85rem;
}
.view-all:hover { color: var(--accent-hover); }

.preview-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.preview-list li {
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.preview-list li:last-child { border-bottom: none; }

.task-title { font-size: 0.9rem; }
.task-meta, .item-meta { font-size: 0.8rem; color: var(--text-muted); }
.item-name { font-size: 0.9rem; }

.empty-state {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-style: italic;
}

/* === Forms === */
.add-form {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.add-form input[type="text"],
.add-form input[type="number"],
.add-form select {
    flex: 1;
    min-width: 150px;
}

input[type="text"],
input[type="number"],
input[type="password"],
select {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.6rem 0.85rem;
    color: var(--text);
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.15s;
}

input:focus, select:focus {
    border-color: var(--accent);
}

button {
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 0.6rem 1.25rem;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.15s;
}

button:hover { background: var(--accent-hover); }

/* === Task List === */
.task-list, .inventory-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.task-item, .inventory-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.85rem 1rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    transition: border-color 0.15s;
}

.task-item:hover, .inventory-item:hover {
    border-color: #444;
}

.task-item.done { opacity: 0.5; }
.task-item.done .task-title { text-decoration: line-through; }

.task-content, .item-content {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.task-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.task-actions, .item-actions {
    display: flex;
    gap: 0.4rem;
    align-items: center;
}

.btn-done, .btn-delete, .btn-reopen, .btn-update {
    width: 32px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-size: 1rem;
}

.btn-done { background: var(--accent); }
.btn-delete { background: var(--danger); }
.btn-delete:hover { background: var(--danger-hover); }
.btn-reopen { background: var(--warning); color: #fff; }
.btn-update { background: var(--accent); }

/* === Inventory Specifics === */
.category-filter {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}

.cat-tag {
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 0.35rem 0.85rem;
    border-radius: 20px;
    font-size: 0.8rem;
    text-decoration: none;
    transition: all 0.15s;
}

.cat-tag:hover { color: var(--text); border-color: #555; }
.cat-tag.active { background: var(--accent); color: #fff; border-color: var(--accent); }

.cat-count {
    font-size: 0.7rem;
    opacity: 0.7;
}

.inline-form {
    display: flex;
    gap: 0.3rem;
    align-items: center;
}

.qty-input { width: 60px; text-align: center; }
.loc-input { width: 100px; }

.inventory-form select { min-width: 140px; }

/* === Login === */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.login-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2.5rem;
    width: 100%;
    max-width: 360px;
    text-align: center;
}

.login-card h1 {
    font-size: 2rem;
    color: var(--accent);
    margin-bottom: 0.25rem;
    letter-spacing: -0.03em;
}

.login-subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.login-card form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.login-card button {
    margin-top: 0.5rem;
}

.error {
    color: var(--danger);
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
}

/* === Responsive === */
@media (max-width: 700px) {
    .dashboard-grid { grid-template-columns: 1fr; }
    .status-grid { flex-direction: column; }
    nav { gap: 1rem; flex-wrap: wrap; height: auto; padding: 0.75rem 1rem; }
    .nav-links { width: 100%; justify-content: center; }
    .nav-user { width: 100%; justify-content: center; margin-left: 0; }
    .add-form { flex-direction: column; }
    .inline-form { flex-wrap: wrap; }
    .inventory-item { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
}
