/* Fonts */
body {
    font-family: 'Outfit', sans-serif;
}
code, pre, .mono {
    font-family: 'JetBrains Mono', monospace;
}

/* App Layout */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar — override Pico's nav defaults */
.sidebar {
    width: 240px;
    min-height: 100vh;
    background: var(--pico-card-background-color);
    border-right: 1px solid var(--pico-muted-border-color);
    display: flex;
    flex-direction: column;
    padding: 1rem 0;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
}

.sidebar,
.sidebar ul {
    flex-direction: column;
}

.sidebar-brand {
    padding: 0.5rem 1.5rem 1.5rem;
    font-size: 1.2rem;
}

.brand-icon {
    margin-right: 0.5rem;
}

.sidebar-nav {
    list-style: none;
    padding: 0;
    margin: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.sidebar-nav li a {
    display: flex;
    align-items: center;
    padding: 0.6rem 1.5rem;
    color: var(--pico-muted-color);
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
    gap: 0.75rem;
}

.sidebar-nav li a:hover,
.sidebar-nav li a.active {
    background: var(--pico-primary-hover-background);
    color: var(--pico-primary);
}

.nav-icon {
    font-size: 1.1rem;
    width: 1.5rem;
    text-align: center;
}

.sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--pico-muted-border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logout-link {
    font-size: 0.85rem;
    color: var(--pico-muted-color);
}

/* Content area */
.content {
    flex: 1;
    margin-left: 240px;
    padding: 2rem;
    max-width: 1200px;
}

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

.login-card {
    max-width: 400px;
    width: 100%;
    padding: 2rem;
}

.login-section {
    margin: 1.5rem 0;
}

.plex-btn {
    width: 100%;
    background: #e5a00d;
    color: #000;
    font-weight: 600;
}

.error-message {
    color: var(--pico-del-color);
}

/* Dashboard Cards */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--pico-card-background-color);
    border-radius: 8px;
    padding: 1.25rem;
    border: 1px solid var(--pico-muted-border-color);
}

.stat-card .label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--pico-muted-color);
}

.stat-card .value {
    font-size: 2rem;
    font-weight: 700;
    margin: 0.25rem 0;
}

/* Tables */
.data-table {
    width: 100%;
}

.data-table th {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--pico-muted-color);
}

/* Activity Feed */
.activity-feed {
    list-style: none;
    padding: 0;
}

.activity-feed li {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--pico-muted-border-color);
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.activity-feed .activity-user {
    font-weight: 600;
    min-width: 100px;
}

.activity-feed .activity-time {
    color: var(--pico-muted-color);
    font-size: 0.85rem;
    margin-left: auto;
}

/* Period Tabs */
.period-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.period-tabs a {
    padding: 0.4rem 1rem;
    border-radius: 4px;
    text-decoration: none;
    color: var(--pico-muted-color);
    border: 1px solid var(--pico-muted-border-color);
}

.period-tabs a.active {
    background: var(--pico-primary);
    color: var(--pico-primary-inverse);
    border-color: var(--pico-primary);
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 60px;
        overflow: hidden;
    }
    .sidebar-brand strong,
    .sidebar-nav li a span:not(.nav-icon),
    .sidebar-footer small,
    .sidebar-footer .logout-link {
        display: none;
    }
    .sidebar-nav li a {
        justify-content: center;
        padding: 0.8rem;
    }
    .content {
        margin-left: 60px;
    }
}
