:root {
    --primary: #2b6cb0;
    --primary-dark: #1a4971;
    --accent: #2f855a;
    --danger: #c53030;
    --bg: #eef1f6;
    --border: #dcdfe4;
    --text: #1f2430;
    --muted: #6b7280;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: linear-gradient(180deg, #f7f9fc 0%, var(--bg) 320px);
    color: var(--text);
}

.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.login-box {
    background: #fff;
    padding: 2.5rem;
    border-radius: 10px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    width: 100%;
    max-width: 320px;
}

.login-box h1 {
    font-size: 1.2rem;
    margin: 0 0 1.25rem;
}

.login-box form {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.login-box label { font-size: 0.85rem; color: #555; }

input, textarea {
    padding: 0.55rem 0.65rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.95rem;
    width: 100%;
}

button {
    cursor: pointer;
    border: none;
    border-radius: 6px;
    padding: 0.6rem 1rem;
    font-size: 0.95rem;
}

.login-box button {
    margin-top: 0.5rem;
    background: var(--primary);
    color: #fff;
}

.login-box button:hover { background: var(--primary-dark); }

.error { color: var(--danger); font-size: 0.85rem; }

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.75rem;
    background: #fff;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 1px 3px rgba(20,30,60,0.04);
}

.topbar-brand { display: flex; align-items: center; gap: 0.6rem; }

.brand-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    display: inline-block;
}

.topbar h1 { font-size: 1.15rem; margin: 0; font-weight: 600; }

.topbar-actions { display: flex; align-items: center; gap: 1rem; }

.btn-small { padding: 0.45rem 0.8rem; font-size: 0.85rem; border-radius: 6px; }

.logout-link { color: var(--muted); text-decoration: none; font-size: 0.85rem; }
.logout-link:hover { color: var(--primary); text-decoration: underline; }

main { padding: 1.75rem; max-width: 1150px; margin: 0 auto; }

.legend {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    font-size: 0.82rem;
    color: var(--muted);
    margin-bottom: 0.85rem;
    padding: 0 0.25rem;
}

.legend span { display: flex; align-items: center; gap: 0.4rem; }

.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.dot-public { background: var(--primary); }
.dot-manual { background: var(--accent); }
.dot-cancelled { background: #9aa0a6; }

#calendar {
    background: #fff;
    padding: 1.25rem;
    border-radius: 12px;
    box-shadow: 0 4px 18px rgba(20,30,60,0.07);
    border: 1px solid var(--border);
}

.fc-event { cursor: pointer; }
.fc-event.is-cancelled { opacity: 0.55; text-decoration: line-through; }

.fc-toolbar-title { font-size: 1.15rem !important; }
.fc-button-primary {
    background: var(--primary) !important;
    border-color: var(--primary) !important;
}
.fc-button-primary:hover { background: var(--primary-dark) !important; }
.fc-daygrid-day.fc-day-today, .fc-timegrid-col.fc-day-today {
    background: rgba(43,108,176,0.06) !important;
}

.modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
}

.modal[hidden] { display: none; }

.modal-content {
    background: #fff;
    border-radius: 12px;
    padding: 1.6rem;
    width: 100%;
    max-width: 440px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 12px 40px rgba(20,30,60,0.2);
}

.modal-content h2 { margin-top: 0; font-size: 1.15rem; }

.meta-line {
    font-size: 0.8rem;
    color: var(--muted);
    background: var(--bg);
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
    margin: -0.2rem 0 0.2rem;
}

#event-form { display: flex; flex-direction: column; gap: 0.6rem; }

#event-form label { font-size: 0.82rem; color: #555; margin-bottom: -0.3rem; }

.row { display: flex; gap: 0.6rem; }
.row > div { flex: 1; }

.checkbox { display: flex; align-items: center; gap: 0.4rem; font-size: 0.9rem; }
.checkbox input { width: auto; }

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }

.btn-secondary { background: #eee; color: #333; }
.btn-secondary:hover { background: #e0e0e0; }

.btn-danger { background: #fff; color: var(--danger); border: 1px solid var(--danger); margin-right: auto; }
.btn-danger:hover { background: #fdecec; }

@media (max-width: 480px) {
    main { padding: 0.75rem; }
    .row { flex-direction: column; }
}
