:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary: #64748b;
    --success: #22c55e;
    --danger: #ef4444;
    --warning: #f59e0b;
    --light: #f8fafc;
    --dark: #1e293b;
    --gray: #94a3b8;
    --border: #e2e8f0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f1f5f9;
    color: var(--dark);
    line-height: 1.6;
}

header {
    background: linear-gradient(120deg, var(--primary), var(--primary-dark));
    color: white;
    padding: 1rem 2rem;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
}

header h1 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

nav {
    display: flex;
    gap: 0.5rem;
}

nav button {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s;
}

nav button:hover {
    background: rgba(255,255,255,0.3);
}

main {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.tab {
    background: white;
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
}

.tab h2 {
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border);
    color: var(--primary);
}

#dashboardCounts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.count-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    text-align: center;
    border-left: 4px solid var(--primary);
}

.count-card h3 {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.count-card p {
    color: var(--secondary);
}

#recentArticles, #articlesList {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.article-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
    transition: transform 0.3s;
}

.article-card:hover {
    transform: translateY(-5px);
}

.article-image {
    height: 160px;
    background-color: var(--gray);
    background-size: cover;
    background-position: center;
}

.article-content {
    padding: 1.5rem;
}

.article-content h3 {
    margin-bottom: 0.5rem;
    color: var(--dark);
}

.article-content p {
    color: var(--secondary);
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.article-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--gray);
    margin-bottom: 1rem;
}

.article-actions {
    display: flex;
    gap: 0.5rem;
}

.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.3s;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

form label {
    display: block;
    margin-bottom: 1rem;
}

form label span {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--dark);
}

form input, form textarea, form select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 1rem;
}

form textarea {
    min-height: 150px;
    resize: vertical;
}

#articleContent {
    grid-column: 1 / -1;
}

form button {
    grid-column: 1 / -1;
    background: var(--primary);
    color: white;
    padding: 1rem;
    border: none;
    border-radius: 4px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background 0.3s;
}

form button:hover {
    background: var(--primary-dark);
}

#notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: 4px;
    color: white;
    font-weight: 500;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
    display: none;
    z-index: 1000;
}

.auth-prompt {
    background: var(--warning);
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1.5rem;
    color: white;
}

.auth-prompt a {
    color: white;
    text-decoration: underline;
    font-weight: bold;
}

@media (max-width: 768px) {
    form {
        grid-template-columns: 1fr;
    }

    #recentArticles, #articlesList {
        grid-template-columns: 1fr;
    }

    nav {
        flex-wrap: wrap;
    }
}
