/* ---------------- General ---------------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f4f7f9;
    margin:0;
    padding:0;
}
.dashboard-header {
    display:flex;
    justify-content:space-between;
    align-items:center;
    background:#1e90ff;
    color:#fff;
    padding:14px 30px;
}
.dashboard-header h1 {
    margin:0;
}
.dashboard-header .logout a {
    color:#fff;
    text-decoration:none;
    font-weight:bold;
}

/* ---------------- Container ---------------- */
.dashboard-container {
    display:flex;
    flex-wrap:wrap;
    gap:20px;
    padding:20px;
    max-width:1200px;
    margin:0 auto;
}

/* ---------------- Form ---------------- */
.dashboard-form {
    flex:1 1 400px;
    background:#fff;
    padding:25px;
    border-radius:10px;
    box-shadow:0 0 15px rgba(0,0,0,0.05);
}
.dashboard-form h2 {
    margin-top:0;
    color:#1e90ff;
    text-align:center;
}
.dashboard-form form input,
.dashboard-form form select,
.dashboard-form form textarea,
.dashboard-form form button {
    width:100%;
    padding:10px;
    margin-bottom:15px;
    border-radius:5px;
    border:1px solid #ccc;
    font-size:14px;
}
.dashboard-form form button {
    background:#1e90ff;
    color:#fff;
    border:none;
    font-weight:bold;
    cursor:pointer;
    transition:0.3s;
}
.dashboard-form form button:hover {
    background:#187bcd;
}

/* archive buttons block */
.dashboard-list a.archive-btn {
    color: #d9534f; /* red */
    text-decoration: none;
    font-weight: bold;
}

.dashboard-list a.unarchive-btn {
    color: #5cb85c; /* green */
    text-decoration: none;
    font-weight: bold;
}

.dashboard-list a.archive-btn:hover,
.dashboard-list a.unarchive-btn:hover {
    text-decoration: underline;
}
/* end archive buttons block */
.preview-img {
    margin-top:10px;
    border-radius:5px;
}

/* ---------------- News List ---------------- */
.dashboard-list {
    flex:2 1 700px;
    background:#fff;
    padding:25px;
    border-radius:10px;
    box-shadow:0 0 15px rgba(0,0,0,0.05);
}
.dashboard-list h2 {
    color:#1e90ff;
    margin-top:0;
    text-align:center;
}
.dashboard-list table {
    width:100%;
    border-collapse:collapse;
}
.dashboard-list table th,
.dashboard-list table td {
    border:1px solid #ddd;
    padding:8px;
    text-align:left;
}
.dashboard-list table th {
    background:#f0f0f0;
}
.dashboard-list table tr:nth-child(even) {
    background:#f9f9f9;
}
.dashboard-list a {
    color:#1e90ff;
    text-decoration:none;
    font-weight:bold;
}
.dashboard-list a:hover {
    text-decoration:underline;
}

/* ---------------- Pagination ---------------- */
.pagination {
    text-align:center;
    margin-top:15px;
}
.pagination a {
    display:inline-block;
    padding:6px 12px;
    margin:3px;
    border:1px solid #1e90ff;
    color:#1e90ff;
    border-radius:5px;
    text-decoration:none;
    transition:0.3s;
}
.pagination a.active, .pagination a:hover {
    background:#1e90ff;
    color:#fff;
}

table img {
    border-radius: 5px;
    object-fit: cover;
}
.preview-img {
    margin-top: 5px;
    border: 1px solid #ccc;
    border-radius: 5px;
}

@media (max-width: 768px) {

    /* Header */
    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
        padding: 15px;
        gap: 8px;
    }

    .dashboard-header h1 {
        font-size: 20px;
    }

    /* Reduce padding */
    .dashboard-form,
    .dashboard-list {
        padding: 15px;
    }

    /* Make table scrollable */
    .dashboard-list {
        overflow-x: auto;
    }

    .dashboard-list table {
        min-width: 750px;
    }

    /* Make action links stack better */
    .dashboard-list td a {
        display: inline-block;
        margin-bottom: 5px;
    }

    /* Make images smaller */
    table img {
        width: 70px;
        height: auto;
    }

}
