@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@500;700;800&display=swap');

:root {
    --bg: #f6f3ec;
    --paper: #ffffff;
    --ink: #121212;
    --muted: #5d584e;
    --line: #1e1b18;
    --line-soft: #6f685d;
    --accent: #121212;
    --success-bg: #e8f7ed;
    --success-text: #176b3b;
    --error-bg: #fdeaea;
    --error-text: #a11c1c;
}

* { box-sizing: border-box; }

body {
    font-family: 'Manrope', sans-serif;
    margin: 0;
    padding: 2rem;
    color: var(--ink);
    min-height: 100vh;
    background:
        radial-gradient(circle at 20% 0%, rgba(255,255,255,0.5), transparent 35%),
        radial-gradient(circle at 90% 100%, rgba(209,190,147,0.18), transparent 42%),
    var(--bg);
}

body.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

nav {
    max-width: 1140px;
    margin: 0 auto 1rem;
    padding: 0.85rem 1rem;
    border: 2px solid var(--line);
    border-radius: 12px;
    background: var(--paper);
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
}

nav a {
    color: var(--ink);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.92rem;
    padding: 0.35rem 0.5rem;
    border-radius: 8px;
}

nav a:hover,
nav a:focus {
    background: #efe9dc;
    outline: none;
}

main {
    max-width: 1140px;
    margin: 0 auto;
    background: var(--paper);
    padding: 1.5rem;
    border: 2px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 4px 0 rgba(0,0,0,0.12);
}

main.login-card {
    max-width: 440px;
    width: 100%;
}

h1, h2, h3 {
    margin-top: 0;
    color: var(--ink);
}

p { color: #3f392f; }

a { color: var(--ink); }

.message {
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    border-radius: 8px;
    border: 1px solid #d8d1c2;
}

.message.success {
    background: var(--success-bg);
    color: var(--success-text);
}

.message.error,
.error {
    background: var(--error-bg);
    color: var(--error-text);
}

form { margin-top: 1rem; }

label {
    display: block;
    margin-bottom: 0.3rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

input,
select,
textarea,
button {
    padding: 0.65rem;
    border: 1.8px solid var(--line-soft);
    border-radius: 9px;
    box-sizing: border-box;
    font-family: inherit;
    font-size: 0.95rem;
}

textarea {
    min-height: 90px;
    resize: vertical;
    width: 100%;
}

button {
    background: var(--accent);
    color: #f8f3e8;
    border: 2px solid var(--line);
    cursor: pointer;
    font-weight: 700;
}

button:hover,
button:focus {
    opacity: 0.95;
}

.danger { background: #b91c1c; }
.secondary { background: #4b5563; }

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.75rem;
    align-items: end;
}

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.card {
    border: 2px solid var(--line);
    padding: 1rem;
    border-radius: 12px;
    background: #fffdf8;
    box-shadow: 0 2px 0 rgba(0,0,0,0.08);
}

.card a {
    display: inline-block;
    margin-top: 0.75rem;
    text-decoration: none;
    font-weight: 700;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1.25rem;
}

th,
td {
    border-bottom: 1px solid #e5e2dc;
    padding: 0.75rem;
    text-align: left;
}

.swatch {
    width: 18px;
    height: 18px;
    display: inline-block;
    border-radius: 4px;
    border: 1px solid #ddd;
    vertical-align: middle;
    margin-right: 0.4rem;
}

.actions form {
    display: inline-block;
    margin: 0 0.25rem 0 0;
}

.actions button {
    padding: 0.45rem 0.75rem;
}

.tools-form {
    display: flex;
    gap: 0.6rem;
    align-items: end;
    flex-wrap: wrap;
    margin: 0 0 1rem;
    padding: 0.9rem;
    border: 2px solid var(--line);
    border-radius: 10px;
    background: #fffdf8;
}

.tools-form .field { min-width: 200px; }
.tools-form input,
.tools-form select { width: 100%; }

.tools-form .submit { background: var(--accent); }

.tools-form .clear-link {
    padding: 0.6rem 0.9rem;
    border-radius: 9px;
    text-decoration: none;
    color: var(--ink);
    background: #ebe5d8;
    border: 2px solid var(--line);
    font-weight: 700;
}

.day-card {
    border: 2px solid var(--line);
    border-radius: 10px;
    padding: 1rem;
    margin-top: 1rem;
    background: #fffdf8;
}

.day-card h3 {
    margin-top: 0;
    margin-bottom: 0.75rem;
}

.event-item {
    background: #fff;
    border: 1px solid #dedad1;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0.8rem;
}

.event-item:last-child { margin-bottom: 0; }

.muted {
    color: #6b7280;
    font-size: 0.95rem;
}

.event-item-title {
    margin: 0 0 0.35rem;
    font-size: 1.06rem;
    line-height: 1.3;
    font-weight: 800;
    color: #111827;
}

.event-item-meta {
    color: #4b5563;
    font-size: 0.9rem;
    margin: 0 0 0.45rem;
}

.location-line { margin: 0.2rem 0 0.25rem; }
.location-line strong {
    display: block;
    color: #374151;
    font-size: 0.95rem;
}
.location-line span {
    display: block;
    color: #6b7280;
    font-size: 0.9rem;
}

.code-list { margin-top: 1.5rem; }

.code-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid #e5e2dc;
}

.code-item strong { display: block; }
.code-item small { color: #666; }

.toggle-btn {
    width: auto;
    padding: 0.45rem 0.75rem;
    margin-bottom: 0;
}

.toggle-btn.disabled { background: #6b7280; }

.login-card input,
.login-card button {
    width: 100%;
    margin-top: 0.75rem;
}

.error {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border: 1px solid #e7c7c7;
    margin-top: 0.75rem;
}

@media (max-width: 760px) {
    body { padding: 1rem; }
    nav { margin-bottom: 0.75rem; }
    main { padding: 1rem; }
    .tools-form .field { min-width: 170px; }
}
