* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    background: #0f0f0f;
    color: #e0e0e0;
    min-height: 100vh;
}

body.light {
    background: #f5f5f5;
    color: #111;
}

nav {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    border-bottom: 1px solid #2a2a2a;
    background: #1a1a1a;
}

body.light nav {
    background: #fff;
    border-color: #ddd;
}

nav h1 {
    font-size: 16px;
    flex: 1;
}

nav input {
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid #333;
    background: #111;
    color: #e0e0e0;
    font-size: 14px;
    width: 220px;
    outline: none;
}

body.light nav input {
    background: #f0f0f0;
    border-color: #ccc;
    color: #111;
}

button {
    padding: 6px 14px;
    border-radius: 6px;
    border: 1px solid #333;
    background: #2a2a2a;
    color: #e0e0e0;
    font-size: 13px;
    cursor: pointer;
}

body.light button {
    background: #e8e8e8;
    border-color: #ccc;
    color: #111;
}

.filters {
    display: flex;
    gap: 8px;
    padding: 12px 20px;
    border-bottom: 1px solid #2a2a2a;
    flex-wrap: wrap;
}

body.light .filters {
    border-color: #ddd;
}

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

.card {
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    padding: 14px;
}

body.light .card {
    background: #fff;
    border-color: #ddd;
}

.card .category {
    font-size: 11px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.card h3 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
}

.card p {
    font-size: 13px;
    color: #aaa;
    line-height: 1.5;
    margin-bottom: 10px;
}

body.light .card p {
    color: #555;
}

.card a {
    display: block;
    font-size: 12px;
    color: #60a5fa;
    margin-bottom: 10px;
    word-break: break-all;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 10px;
    border-top: 1px solid #2a2a2a;
    font-size: 12px;
    color: #666;
}

body.light .card-footer {
    border-color: #eee;
}

.overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.overlay.open {
    display: flex;
}

.modal {
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 10px;
    padding: 24px;
    width: 100%;
    max-width: 440px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

body.light .modal {
    background: #fff;
    border-color: #ddd;
}

.modal h2 {
    font-size: 16px;
}

.modal label {
    font-size: 12px;
    color: #888;
    display: block;
    margin-bottom: 4px;
}

.modal input,
.modal textarea,
.modal select {
    width: 100%;
    padding: 8px 10px;
    background: #111;
    border: 1px solid #333;
    border-radius: 6px;
    color: #e0e0e0;
    font-size: 13px;
    font-family: sans-serif;
    outline: none;
}

body.light .modal input,
body.light .modal textarea,
body.light .modal select {
    background: #f5f5f5;
    border-color: #ccc;
    color: #111;
}

.modal textarea {
    min-height: 80px;
    resize: vertical;
    line-height: 1.5;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

#empty-message {
    text-align: center;
    padding: 60px;
    color: #555;
}