body {
    font-family: Arial, Helvetica, sans-serif;
    background: #f5f7fb;
    margin: 0;
    color: #222;
}

.page {
    max-width: 900px;
    margin: 40px auto;
    background: white;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.08);
}

h1, h2 {
    margin-top: 0;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.topbar a {
    text-decoration: none;
    color: #4CAF50;
    font-weight: bold;
    margin-left: 12px;
}

form {
    margin-bottom: 20px;
}

input[type="text"],
input[type="email"],
input[type="password"],
textarea {
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid #d7dbe3;
    border-radius: 8px;
    box-sizing: border-box;
    font: inherit;
}

button {
    padding: 10px 14px;
    border: none;
    border-radius: 8px;
    background: #4CAF50;
    color: white;
    cursor: pointer;
}

button:hover {
    opacity: 0.95;
}

.card a {
    text-decoration: none;
    color: #222;
    font-weight: 600;
    display: block;
}

.button-danger {
    background: #e74c3c;
}

.list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.list li {
    padding: 12px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 10px;
    background: #fafafa;
}

.list a {
    text-decoration: none;
    color: #222;
    font-weight: 600;
}

.muted {
    color: #666;
}

.auth-box {
    max-width: 420px;
    margin: 60px auto;
    background: white;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.08);
}

.error {
    margin-bottom: 15px;
    padding: 10px;
    background: rgba(255,0,0,0.08);
    color: #b00020;
    border-radius: 8px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px;
}

.card {
    padding: 16px;
    border-radius: 10px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    transition: transform 0.15s ease, box-shadow 0.2s ease;

    display: flex;              /* ADD THIS */
    flex-direction: column;     /* ADD THIS */
    gap: 6px;                   /* ADD THIS */
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

h1 {
    font-size: 24px;
}

h2 {
    margin-top: 30px;
}

a:hover {
    opacity: 0.8;
}

.card a:hover {
    color: #4CAF50;
}

.tag {
    display: inline-flex;        /* key fix */
    align-items: center;

    width: fit-content;          /* prevents stretching */
    max-width: 100%;             /* safety */

    background: #eef2ff;
    color: #4CAF50;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.8em;
    text-decoration: none;
    margin-right: 6px;
    margin-bottom: 4px;
}

.tag:hover {
    background: #e0e7ff;
}

.success {
    background: #e8f5e9;
    color: #2e7d32;
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-weight: 500;
}

.success-inline {
    color: #2e7d32;
    font-weight: 600;
    margin-bottom: 12px;
}

.section-block {
    margin-bottom: 24px;
}