:root {
    --bg-dark: #0f111a;
    --bg-panel: #161b22;
    --bg-card: #1f242e;
    --primary: #9b51e0;
    --primary-hover: #b478f2;
    --text-main: #e2e8f0;
    --text-muted: #94a3b8;
    --border: #2d3342;
    --success: #10b981;
    --kamas: #fbbf24;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* --- Layout --- */
.app-container {
    display: flex;
    width: 100%;
    height: 100%;
}

.sidebar {
    width: 260px;
    background-color: var(--bg-panel);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
    z-index: 100;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

/* --- Sidebar --- */
.logo {
    padding: 24px 20px;
    border-bottom: 1px solid var(--border);
}

.logo h2 {
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 1px;
}

.logo span {
    color: var(--primary);
}

.nav-menu {
    flex: 1;
    padding: 20px 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-item {
    padding: 10px 16px;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.2s;
}

.nav-item:hover {
    background-color: rgba(155, 81, 224, 0.1);
    color: var(--text-main);
}

.nav-item.active {
    background-color: var(--primary);
    color: white;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar {
    width: 36px;
    height: 36px;
    background-color: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.9rem;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 600;
    font-size: 0.85rem;
}

.user-status {
    font-size: 0.7rem;
    color: var(--success);
}

/* --- Header Controls --- */
.top-header {
    background-color: var(--bg-panel);
    border-bottom: 1px solid var(--border);
    padding: 16px 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.header-title {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-title h1 {
    font-size: 1.3rem;
    font-weight: 600;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-main);
    font-size: 1.5rem;
    cursor: pointer;
}

.header-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.control-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.control-group label {
    font-size: 0.85rem;
    color: var(--text-muted);
    white-space: nowrap;
}

input, select {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 6px 10px;
    border-radius: 4px;
    font-family: inherit;
    font-size: 0.85rem;
    outline: none;
}

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

#team-size {
    width: 60px;
    text-align: center;
}

#max-level {
    width: 80px;
    text-align: center;
}

.search-group {
    flex-grow: 1;
    min-width: 200px;
}

#search-input {
    width: 100%;
}

/* --- Content Area --- */
.content-area {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    align-content: start;
}

/* --- Almanax Card --- */
.almanax-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: transform 0.2s, border-color 0.2s;
}

.almanax-card:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    padding-bottom: 8px;
}

.date-badge {
    background-color: rgba(155, 81, 224, 0.15);
    color: var(--primary-hover);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.bonus-type {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.card-body {
    display: flex;
    gap: 12px;
    align-items: center;
}

.item-icon {
    width: 48px;
    height: 48px;
    background-color: var(--bg-panel);
    border-radius: 6px;
    padding: 4px;
    object-fit: contain;
}

.item-info {
    flex: 1;
    min-width: 0; /* for text truncation */
}

.item-name {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.item-level {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.item-quantity {
    color: var(--primary-hover);
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 2px;
}

.item-kamas {
    color: var(--kamas);
    font-size: 0.75rem;
}

.bonus-desc {
    background-color: var(--bg-panel);
    padding: 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    line-height: 1.4;
    color: #cbd5e1;
}

.loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* --- Responsive Mobile --- */
@media (max-width: 768px) {
    .app-container {
        position: relative;
    }

    .sidebar {
        position: absolute;
        top: 0;
        left: 0;
        height: 100%;
        transform: translateX(-100%);
        box-shadow: 2px 0 10px rgba(0,0,0,0.5);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .mobile-menu-btn {
        display: block;
    }

    .top-header {
        padding: 12px 16px;
    }

    .content-area {
        padding: 12px;
        grid-template-columns: 1fr;
    }
}

