* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 0;
    background: #f4f7f9;
    color: #1f2937;
    line-height: 1.5;
}

header {
    background: #0b3d4e;
    color: #ffffff;
    padding: 1.5rem 1rem;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

header h1 {
    margin: 0;
    font-size: 1.75rem;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-info {
    font-size: 0.95rem;
    opacity: 0.95;
    background: rgba(255,255,255,0.15);
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
}

.btn-secondary {
    background: rgba(255,255,255,0.2);
    color: #ffffff;
    border: 1px solid rgba(255,255,255,0.3);
    padding: 0.4rem 0.9rem;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.9rem;
}

.btn-secondary:hover {
    background: rgba(255,255,255,0.3);
}

header .subtitle {
    margin: 0.5rem 0 0;
    opacity: 0.9;
    font-size: 0.95rem;
}

main {
    max-width: 720px;
    margin: 1rem auto;
    padding: 0 1rem;
}

.card {
    background: #ffffff;
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.card h2 {
    margin-top: 0;
    font-size: 1.2rem;
    color: #0b3d4e;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

form {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.4rem;
    align-items: center;
}

.form-row.full {
    grid-column: 1 / -1;
    grid-template-columns: 1fr;
}

label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #374151;
}

.required {
    color: #dc2626;
}

input, select, textarea {
    width: 100%;
    padding: 0.55rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 1rem;
    background: #fff;
}

input[type="file"] {
    padding: 0.4rem 0;
    font-size: 0.95rem;
    background: #fff;
}

input[type="color"] {
    height: 44px;
    border: none;
    cursor: pointer;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #0b3d4e;
    box-shadow: 0 0 0 3px rgba(11, 61, 78, 0.15);
}

.form-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.25rem;
}

button {
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

button[type="submit"], .btn-primary {
    background: #0b3d4e;
    color: #ffffff;
}

button[type="submit"]:hover, .btn-primary:hover {
    background: #093241;
}

.secondary {
    background: #e5e7eb;
    color: #1f2937;
}

.secondary:hover {
    background: #d1d5db;
}

.btn-primary.small {
    padding: 0.45rem 0.9rem;
    font-size: 0.9rem;
}

/* Flash-meddelelser */
.flashes {
    margin-bottom: 1rem;
}

.flash {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}

.flash.success {
    background: #eef7ee;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.flash.error {
    background: #fdecea;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.flash.info {
    background: #e0f0f5;
    color: #0b3d4e;
    border: 1px solid #bae6fd;
}

/* Auth-kort */
.auth-card {
    max-width: 400px;
    margin: 2rem auto;
}

.auth-footer {
    margin-top: 1rem;
    font-size: 0.9rem;
    text-align: center;
}

.auth-footer a {
    color: #0b3d4e;
    text-decoration: underline;
}

.auth-footer a:hover {
    text-decoration: none;
}

/* Hjælpeboble / talebobble */
.help-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    min-width: 20px;
    background: #0b3d4e;
    color: #ffffff;
    border-radius: 50%;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    user-select: none;
}

.tooltip {
    position: fixed;
    background: #2d3748;
    color: #ffffff;
    padding: 0.7rem 0.9rem;
    border-radius: 10px;
    font-size: 0.9rem;
    line-height: 1.45;
    pointer-events: none;
    z-index: 1000;
    max-width: 320px;
    box-shadow: 0 6px 16px rgba(0,0,0,0.25);
    display: none;
    border: 1px solid rgba(255,255,255,0.1);
}

/* Filtre */
.filters .filter-bar {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-items: stretch;
}

.filters .filter-bar button {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

@media (min-width: 600px) {
    .filters .filter-bar {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
    }
    .filters .filter-bar select,
    .filters .filter-bar input[type="text"] {
        flex: 1;
        min-width: 180px;
    }
}

/* Indtægsliste */
.entries-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.entry {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 0.9rem;
    background: #fff;
    position: relative;
    animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: none; }
}

.entry-meta {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.4rem;
}

.entry-date {
    font-weight: 700;
    color: #0b3d4e;
}

.entry-type {
    font-size: 0.75rem;
    padding: 0.15rem 0.5rem;
    border-radius: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.entry-description {
    font-size: 1.05rem;
    margin: 0.25rem 0;
}

.entry-notes {
    font-size: 0.9rem;
    color: #4b5563;
    margin-top: 0.25rem;
    white-space: pre-wrap;
}

/* Billeder */
.entry-images {
    display: flex;
    gap: 0.6rem;
    margin-top: 0.7rem;
    flex-wrap: wrap;
}

.entry-img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    background: #f3f4f6;
}

.image-hint {
    font-size: 0.78rem;
    color: #6b7280;
    margin-top: 0.25rem;
}

.image-preview {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.image-preview .preview-wrap {
    position: relative;
    width: 80px;
    height: 80px;
}

.image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #d1d5db;
}

.image-preview .remove-thumb {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #dc2626;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-preview .remove-thumb:hover {
    background: #b91c1c;
}

.image-list {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #e5e7eb;
}

.image-list .existing-wrap {
    position: relative;
    display: inline-block;
    margin-right: 0.6rem;
    margin-bottom: 0.6rem;
}

.image-list img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    background: #f3f4f6;
}

.image-list .remove-existing {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #dc2626;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-list .remove-existing:hover {
    background: #b91c1c;
}

/* Log-typer liste */
.logtypes-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.logtype-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.9rem;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

.logtype-color {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1px solid #d1d5db;
    flex-shrink: 0;
}

.logtype-name {
    font-weight: 600;
    color: #1f2937;
    flex: 1;
}

.logtype-slug {
    font-size: 0.8rem;
    color: #6b7280;
    font-family: monospace;
    flex: 1;
}

.logtype-delete {
    background: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fecaca;
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
}

.logtype-delete:hover {
    background: #fecaca;
}

.hidden {
    display: none !important;
}

.empty-state {
    text-align: center;
    color: #6b7280;
    padding: 2rem 1rem;
}

footer {
    text-align: center;
    padding: 1.5rem 1rem;
    font-size: 0.8rem;
    color: #6b7280;
}

footer code {
    background: #eef2f3;
    padding: 0.1rem 0.3rem;
    border-radius: 4px;
}

.entry-actions {
    margin-top: 0.6rem;
    display: flex;
    gap: 0.5rem;
}

.entry-actions button {
    font-size: 0.85rem;
    padding: 0.35rem 0.7rem;
}

.entry-actions .delete {
    background: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.entry-actions .delete:hover {
    background: #fecaca;
}

.entry-actions .edit {
    background: #e5e7eb;
    color: #1f2937;
}

.entry-actions .edit:hover {
    background: #d1d5db;
}

.entry.ny-log {
    border-color: #0b3d4e;
    box-shadow: 0 0 0 3px rgba(11, 61, 78, 0.15);
    animation: fadeIn 0.25s ease, pulseNy 2s ease;
}

@keyframes pulseNy {
    0% { box-shadow: 0 0 0 3px rgba(11, 61, 78, 0.15); }
    50% { box-shadow: 0 0 0 8px rgba(11, 61, 78, 0.25); }
    100% { box-shadow: 0 0 0 3px rgba(11, 61, 78, 0.15); }
}
